- Plug in your Arduino
- Select your Arduino board from the Arduino IDE Tools > Board menu
- Select your Arduino board's port from the Tools > Port menu
- Select File > Preferences from the Arduino IDE menus.
- Check the box next to "Show verbose output during: [] upload".
- Click the OK button.
- Select Sketch > Upload from the Arduino IDE menus.
- Wait for the upload to finish.
- Scroll up in the black output panel at the bottom of the Arduino IDE window until you see the
avrdudecommand.
On Windows with Uno selected it looks something like:C:\Program Files (x86)\arduino-1.6.10\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\arduino-1.6.10\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:C:\Users\per\AppData\Local\Temp\builda0905d717cd3fb20c5f6c59067701315.tmp/serial.ino.hex:i - Select and copy the
avrdudecommand. - Paste the
avrdudecommand to the command line. - Change the file name to the
.hexfile you want to upload.
In my case I also had to add quotes around the paths that had spaces in them. - Press Enter
You can use the same system to generate the correct commands for burning a bootloader or to upload using a programmer.