Preferences.txt option for build directory


In the 1.8.13 version Arduino IDE I can add this line to preferences.txt:


and this will cause the files generated by the compilation process to be deposited in the "build" directory per
the path on the right side of the =.

It doesn't appear to work when I run IDE 2.0. The build directory remains empty.
Does the IDE 2.0 even use the preferences.txt file? Another file or mechanism to set this type of option?
My main purpose is to get the "map" file for inspection of binary sizes.


Does the IDE 2.0 even use the preferences.txt file?

No. Arduino IDE 2.0 completely ignores the classic Arduino IDE's preferences.txt file.

Arduino IDE 2.0 has multiple configuration files, which are stored at ~/.arduinoIDE on Linux:

Unfortunately, I'm not aware of a way to customize the build directory on Arduino IDE 2.x. You can save the binaries to the build subfolder of the sketch folder via Sketch > Export Compiled Binary, and I know the boards platform can be configured to make that feature also export other useful files (e.g., ATTinyCore also exports the assembly listing), but there's not guarantee the boards platform you're using is already configured to do that. You could certainly modify the platform to do it, but I don't know whether you want to go there.

You can certainly do this by running Arduino CLI directly, using the --build-path flag:

What I would like to see happen eventually is for the Arduino CLI configuration system to be expanded to cover all useful settings. This functionality you're missing is more of a deficiency in Arduino CLI than in Arduino IDE 2.x, since Arduino CLI is responsible for all non-GUI tasks.

All it took was exporting the build directory as you described. The .map file was included!
Thank you for the help!


You’re welcome. I’m really glad to hear the solution was so easy. Enjoy!