Xcode 12 Upgrade, Apple Silicon and arm64:
Covers XCode 12 arm64 arch issue on simulator and with third party libraries added via cocoapods.
Apple Silicon :
Apple has come up with its own ARM instruction set based processor M1 aka “Apple Silicon” same used as in iPhones, instead of the intel’s x86–64 instructions based processor used in existing Macs and Windows.
Resulting being able to run all the native iOS apps on Macs with Apple Silicon.
Arm64 Simulator Issue on Xcode 12:
When I tried building for simulator on Xcode 12.2, I encountered compilation error :
“building for iOS Simulator, but linking in object file built for iOS, for architecture arm64”
It seems obvious as arm64 is for devices not for simulator but Why ?.
If you check in XCode 12 onwards in Build Settings -> Architecture, is set to $(ARCHS_STANDARD) unlike older XCode 11 i.e. armv7, armv7s and arm64
Thus to make it work you need to exclude this for Simulator SDK.
Arm64 Cocoa-pods Issue on Xcode 12:
I also encountered below erros with some of the third party libraries that have not updated their podspecs.
PrecompileSwiftBridgingHeader normal x86_64, CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler, CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler failed.
To resolve the above issue with them add either in your .xconfig file or in Podfile for every target.
EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
Follow me Rahul Goel for further updates.