Specify a custom build directory

arduino-builder

  • A command-line tool for compiling arduino sketches.
    DEPRECATION WARNING: This tool is being phased out in favor of `arduino`.
    More information: <https://github.com/arduino/arduino-builder>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

arduino-builder -build-path {{path/to/build_directory}}

click the source code to copy install arduino-builder on any operating system with command-not-found.com