I have an AppleScript Application which at some point calls a 64-bit intel binary (x86_64), let’s call it
cmd The code to do so is
do shell script "cmd". However, on a clean Apple Silicon (M1) system, I get the error message
Bad CPU Type in executable.
I tried specifying the architecture by running
do shell script "env /usr/bin/arch -x86_64 cmd" which gives a slightly different error message.
LSArchitecturePriority with the string array item
x86_64 to the Info.plist doesn’t seem to make a difference.
I checked the Application’s binary
applet, and that’s supporting both x86_64 and arm64 architecture. And indeed, when I in Finder’s Info panel I check the “Open using Rosetta” everything works as expected and wanted.
However, can I mark my application to use Rosetta at compile time, so the end-user doesn’t have to do this?
(when Rosetta is installed, everything works just fine. I just want to get rid of those “Bad CPU type” errors)
Also: I hope to get rid of these binaries in the near future, but I’m just not there yet. Any help would be appreciated.