Description
Describe the problem
Apple Silicon-based machines (M1, M2 CPUs) are able to run applications built for x86 host thanks to the Rosetta 2 binary translator.
Rosetta 2 is not installed by default, but when an x86 application is started on an Apple Silicon-based machine, macOS displays a dialog offering the installation to the user:
https://support.apple.com/en-us/HT211861
Since native Apple Silicon builds have better performance, Arduino produced the first Arduino IDE 2.x build for this target and published it in December. Unlike the x86 build of Arduino IDE 2.x, starting the Apple Silicon build does not result in the Rosetta 2 installation dialog. Even though Rosetta 2 is not needed by the Arduino IDE application itself, the IDE uses a wide array of additional tools. Many of these are not available in an Apple Silicon build:
- serial-discovery
- serial-monitor
- GCC
- AVRDUDE
- ...
🐛 These tools produce an error when Arduino IDE attempts to execute them:
bad CPU type in executable
This produces an array of symptoms. For example, no serial ports are discovered (due to not having a functional serial-discovery tool).
To reproduce
- Download the Apple Silicon build of Arduino IDE:
https://www.arduino.cc/en/software - Start Arduino IDE on an Apple Silicon machine that does not have Rosetta 2 installed.
🐛 No Rosetta 2 installation prompt is shown.
🐛 All x86 targeted tools fail to execute.
🐛 The IDE displays a variety of symptoms, including no ports listed, failed compilation ...
Expected behavior
The dependency on Rosetta 2 is communicated to the user.
Arduino IDE version
2.0.3
Operating system
macOS
Operating system version
Ventura
Additional context
Fix
- Open your Applications folder in Finder.
- Open the Utilities folder.
- Double-click on "Terminal".
- Type the following command in the Terminal window:
softwareupdate --install-rosetta
- Accept the license agreement.
- Wait for the installation to finish.
Additional reports
- https://forum.arduino.cc/t/bad-cpu-type-in-executable-compile-error/1064440
- https://forum.arduino.cc/t/24-mac-m1-bad-cpu-type-in-executable/1071674
- https://forum.arduino.cc/t/one-mac-sees-my-arduinos-the-other-doesnt/1076201/9
- No Ports Recognized with IDE 2.0.3 ARM64 build (Apple M1) on Mac Ventura #1796 (unconfirmed)
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details