Hi @boolrules. This error can be caused by not having Apple's Rosetta 2 software installed. Even though your Arduino IDE 2.x installation is a native Apple Silicon build, the tools used by Arduino IDE are still built for x86 host architecture. That is no problem as long as you have Rosetta 2 installed because it allows x86 applications to run perfectly on the Apple Silicon machines.
Normally when you start an x86 application macOS presents a dialog explaining that you need to install Rosetta 2:
However, I'm not sure whether that happens in this case where the x86 application is a tool running in a subprocess. This is a fairly new situation because we published the first native Apple Silicon build of Arduino IDE only a few weeks ago. I'll investigate the situation (unfortunately I already have Rosetta 2 installed on my M1 machine).
Please try manually installing Rosetta 2. I'll provide instructions:
- 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.
Now tray compiling your sketch again in Arduino IDE. Hopefully this time that "bad CPU type in executable" error will not occur and everything will work correctly.
