All the IDE would do is run avrdude. If you need to upload hex files you should learn to use avrdude directly. By turning on verbose upload logging (see Arduino->Preferences...) you can see the command line that the IDE uses to upload your sketch. That will provide a good template. For example: