I have a question about excluding the arm64 architectures when building for iOS Simulators on m1 machines using React Native. I have successfully excluded arm64 from general project and pods by adding 'arm64' in every box with Excluded Architectures
. It works, but every time I add or remove a new library and use pod install
I would have to do exclusion all over again by hand. There are answers for how to solve it by using Podfile post_install
, but it doesn't seem to work.
My env:
MacBook Pro M1 Pro
React: 17.0.2
React-Native: 0.66.1
XCode 13
My pod file post_install:
post_install do |installer|
$RNMBGL.post_install(installer)
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer) <- this line means anything?
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
#this should exclude arm64
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
end
end
end
The similar question I was referring to: Xcode 12, building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64'