Support Apple Silicon Architecture

2023, Feb 23    

🦄️ Finally, in Xcode 14.3 it is no longer supporting rosetta mode. For all the preivous temprary configuration which can work under rosetta mode no it no longer works in the coming version of Xcode.

1. Why so troublesome? 

It is quite a common pain point to support your Xcode fully work under Apple Silicon environments due to multiple reasons:

  • When M1 chip just come out, early versions of Xcode doesn’t come with arm64 simulator environments, hence developers have to run under Rosetta 😂.
  • Legacy third party vendor binary frameworks doesn’t contain valid arm64 simulator architectures. Image that you have a long list of third-party vendor binary frameworks like that. There is a long list of task need to be done before you can build your Xcode under Apple Silicon Arch mode.
  • It is almost the same time when Apple promotes the M1 chip, the company also starts to promote the official binary format: .xcframework, which is the official solution to replace the legacy .framework, but the upgrade takes time. Before that, not all project you can support running under Apple Silicon Arch mode.

2. How to configure: 

Tips Ensure for the ONLY_ACTIVE_ARCH and EXCLUDED_ARCHS are follow the xcode’s default configuration. In previous days, some developers will exclude arm64 simulator arch type, but this will leads to the build artifact does not contain amr64 simulator arch type. If the project target is for a xcframework, such configuration will make the downstream modules/applications not able to compile under Apple Silicon mode.

Tips If part of the dependency does not support M1 chip mode, the compilation error could be misleading. For example, you may see an error indicating one of your dependency does not have a proper module interface, but in fact, the issue is caused by another different dependency module which does not support M1 chip at all.

Tips How to check if your dependency supports M1 chip? -[x] if in binary format, it must be in .xcframework format, the previous .framework format doesn’t work!! -[x] if in .xcframework format, go to the folder, check if the simulator/ios/mac os provides all the architecture via lipo

TOC