How do I upload a hex file firmware to a target board without using the arduino IDE?
If you turn on verbose output in the preferences of the IDE, you can see the full command line that the IDE uses to run avrdude.

The verbose output will also let you see what temporary directory is being used for the hex file, so you can grab it.