Xcode15 跑模拟器报错
方式一
1、需要在 Podfile中添加如下代码:
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
2、Targets > Project > Build Settings > Architectures > Excluded Architectures > 给 Debug 添加 arm64。
3、如果2不奏效,可以选择:Build Settings > 点击 + > User-Defined > 添加 arm64 arm64e x86_64。
报错1:Sandbox: rsync.samba(6673) deny(1)
报错内容:
Sandbox: rsync.samba(6673) deny(1) file-write-create /Users/chen/Library/Developer/Xcode/DerivedData/BowlingSport-eoyurjhvtaxeftcewfwjtnuxsgai/Build/Products/Debug-iphonesimulator/BowlingSport.app/Frameworks/Alamofire.framework/_CodeSignature
解决办法:TARGETS > Building Settings > Build Options > User Script Sandboxing 设置为 NO
方式二
参考自阿南
post_install do |installer|
flutter_post_install(installer) if defined?(flutter_post_install)
installer.aggregate_targets.each do |target|
target.xcconfigs.each do |variant, xcconfig|
xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)
IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
end
end
installer.pod_target_subprojects.flat_map { |p| p.targets }.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
xcconfig_path = config.base_configuration_reference.real_path
IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
end
end
end
Xcode14 跑模拟器报错
需要在 Podfile中添加如下代码:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
报错信息如下:
SDK does not contain 'libarclite' at the path '.../usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target
解决办法: 把所有 Target 中的 Build Seetings 中的 Delopment 的 iOS Deployment Target 修改为最低支持 iOS 12.0