36

Where does the Arduino IDE save the binaries on Mac OS X?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
IAmNaN
  • 10,305
  • 3
  • 53
  • 51

7 Answers7

56

In the Arduino software: go to File -> Preferences and then select Show verbose output during -> compilation.

enter image description here

Finally, when you are compiling, the program will show you lots of data. At the last lines, you will find the path1 to the .hex file.


1Every time the path changes!

zmechanic
  • 1,842
  • 21
  • 27
uDalillu
  • 955
  • 8
  • 11
  • It's true the that path changes every time. If you want to locate the files without having to read though the output, see my answer for 2 tools you can use to script whatever work you need to do with the files. – Bruno Bronosky Dec 27 '15 at 04:02
36

Arduino 1.6.5 has a new command: Under the Sketch menu, select Export compiled Binary, then Show Sketch Folder. There it is.

Dirk
  • 2,335
  • 24
  • 36
7

Arduino IDE uses the mktemp command to create the temp directory on Mac and Linux. However, on Mac the default $TMPDIR env var is not /tmp/ as it is on Linux. On Mac it's under /var/folders and it is randomly generated on boot. That complicates things a little, but here are tricks you can add to your toolkit (as aliases, functions, shell scripts, etc.) to help you find what you need.

To find the hex files

find $TMPDIR -name \*.hex -exec ls -lrt {} \; #<-- you need that backslash before and space after the semicolon

To find build directories

ls -ldrt $TMPDIR/build*

NOTE: The ls flags of r and t cause the listing to be "reverse" sorted by "time" respectively. This means that the newest will be on the bottom.

Bruno Bronosky
  • 66,273
  • 12
  • 162
  • 149
1

What UDalillu said. The trick also works on Windows. On XP it ended up in C:\Documents and Settings\Your_User_Name\Local Settings\Temp\buildxxxxx\ (the xxx number changes for each build, pick the most recent).

CuriousMarc
  • 501
  • 6
  • 11
0

The arduino web page http://arduino.cc/en/Hacking/BuildProcess described

During a "Verify" the .hex file is written to /tmp (on Mac and Linux) or \Documents and Settings\\Local Settings\Temp (on Windows)

I am using fedora19 64bit, and when i check my /tmp the build directory created is /tmp/build8102....tmp/

adesst
  • 297
  • 3
  • 7
  • 1
    The page you reference is simply wrong. While both of the *nix versions of Arduino IDE use the mktemp command to create the temp directory, on Mac the default $TMPDIR env var is not /tmp/ it's under /var/folders and it is randomly generated on boot. So on a Mac, do `ls -ldrt $TMPDIR/build*` – Bruno Bronosky Oct 20 '14 at 14:22
  • Windows path is wrong. I posted the right one, for XP at least. – CuriousMarc Dec 26 '14 at 02:02
0

I made a simple tutorial here with images

vivek
  • 47
  • 1
  • 4
-2

It is very beautifully explained in the following blog Where to find Arduino Hex files or Output Binaries I hope this helps :)

Albert
  • 415
  • 5
  • 15
  • 1
    That's windows, the OP specifically requests mac – taxilian Dec 01 '18 at 21:28
  • Cool @taxilian I was just trying to help and moreover, I think that was a good article on a similar topic and would help someone visiting the question by it's header "Where are the hex files compiled by Arduino?" – Albert Dec 02 '18 at 10:00