[XCode] How to Run iOS Simulator on M1 Mac
If you get an error “<your project path> building for iOS Simulator, but linking in an object file built for iOS, file <your project path> for architecture arm64”, you need to open it using Rosetta
This error message shows when you try to run iOS stimulators on M1 Mac.
If you haven’t installed Rosetta 2 on your Mac, you can install it by the command line tool. Simply copy and paste the following command to your terminal:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
After you finish the installation, right-click on Xcode icon and select Get Info.
Tick Open using Rosetta.
Now you are able to run your iOS simulators.
Please note you can’t run Swift Playground using Rosetta, if you need to run something on Playground, you must uncheck Open using Rosetta.