在podfile中加入以下代码
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = 'arm64 arm64e'
config.build_settings['VALID_ARCHS'] = 'arm64 arm64e'
if config.name == 'Debug'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
else
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
end
更新:xcode12之后这种设置貌似会导致模拟器编译报错