You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级CocoaPods从1.11.1到1.11.2后无法在iOS模拟器运行应用咨询

问题产生原因

CocoaPods 1.11.2存在已知的编译架构配置缺陷,生成Pods项目编译规则时,会错误将iOS模拟器对应的x86_64、arm64架构加入排除列表,或未将模拟器架构纳入有效编译范围,最终导致架构不匹配编译失败,应用无法在模拟器上运行,该问题在搭载Apple Silicon芯片的Mac设备上出现概率更高。

解决方法
  • 临时修复(执行pod install后会重置)
    打开Xcode内的Pods子项目,进入Build Settings页面,找到Excluded Architectures配置项,删除Debug模式下针对iOS Simulator平台添加的所有架构排除规则即可。
  • 永久配置修复
    在项目的Podfile末尾添加以下规则,强制指定模拟器编译时不排除任何架构,每次执行pod install都会自动应用该配置:
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = ""
    end
  end
end

保存Podfile后,在项目根目录执行pod install重新生成Pods配置即可生效。

  • 版本替换修复
    该缺陷已在后续CocoaPods稳定版中修复,可执行sudo gem install cocoapods直接升级到最新版本;若暂时不需要升级,也可以降级回无问题的1.11.1版本,执行命令:sudo gem install cocoapods -v 1.11.1

如果是搭载Apple Silicon芯片的Mac,完成上述操作后仍有问题,可以尝试在Xcode顶部菜单栏选择Product -> Destination -> Destination Architectures -> Show Both,同时开启两种架构的模拟器支持。

内容的提问来源于stack exchange,提问作者Tri Tran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.28 22:45:06