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

构建iOS模拟器时遇x86_64-apple-ios-simulator模块未找到错误求助

解决M1 Mac上iOS模拟器构建提示"Could not find module for target 'x86_64-apple-ios-simulator'"的方案
  • 彻底清理并重装Pods
    执行以下命令清除所有Pods相关缓存和文件:

    pod deintegrate
    rm -rf Podfile.lock
    rm -rf ~/Library/Caches/CocoaPods
    rm -rf ./Pods
    

    之后重新执行pod install,注意暂时注释Podfile中自定义的架构配置,待安装完成后再按需调整。

  • 以Rosetta模式运行Xcode
    找到Applications目录中的Xcode.app,右键选择「显示简介」,勾选「使用Rosetta打开」,重启Xcode后重新构建项目。该方法适配部分未支持arm64模拟器的依赖(比如Firebase部分组件)。

  • 通过Podfile钩子统一模拟器架构配置
    在Podfile末尾添加以下配置,强制所有Pods针对模拟器构建x86_64架构:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
          config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
      end
    end
    

    执行pod install生效配置,再用Cmd+Shift+K清理项目后重新构建。

  • 重置Xcode Derived Data
    打开Xcode,依次点击顶部菜单「Xcode」→「Settings」→「Locations」,点击Derived Data旁的箭头,删除当前项目对应的文件夹(或整个Derived Data目录),重启Xcode后重新构建。

  • 检查项目与Pods的「Excluded Architectures」配置
    打开项目Build Settings,搜索「Excluded Architectures」,确保Debug/Release模式下,iOS Simulator的配置未排除x86_64(可保留对arm64的排除);同时检查Pods项目的相同配置,确保与主项目一致。

内容的提问来源于stack exchange,提问作者Marcin Żmigrodzki

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.27 00:33:12