Debug xcode project on mac M1 machine

Our project was developed on mac with intel chip, but recently some developers buy the mac with M1 chip, and they can’t build the…

Debug xcode project on mac M1 machine

Our project was developed on mac with intel chip, but recently some developers buy the mac with M1 chip, and they can’t build the application on their machine, here is first solution I found that work on M1 machine.

  1. Set open using Rosetta for xcode
  2. Install ffi with x86_64 architecture
  3. Run pod install with x86_64 architecture

Set open using Rosetta for xcode

Right click the xcode on the Finder, and select Get Info context menu, and select Open using Rosetta checkbox like below.

Install dependency for cocapods with x86_64 architecture

Run the following command to avoid pod install error.sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

Build and run the application

Open the project with xcode, and run the build, thanks God, the application can run on iOS Simulator on M1 machine now.


Next step

When I have time, maybe I can investigate how to update the project setting, so that the application can work on M1 machine without using Rosetta setting.