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

更新macOS和Xcode后iOS模拟器Flutter构建失败

解决iOS模拟器调试时的Provisioning Profile报错问题

针对更新macOS Sonoma 14.0、Xcode 15后,使用Flutter 3.16.0-6.0.pre.12在iOS模拟器构建项目时出现的"Runner" requires a provisioning profile报错,以下是针对性解决步骤:

  • 调整Xcode签名配置
    打开项目的ios/Runner.xcodeproj,进入「Signing & Capabilities」标签页:

    1. 选中「Runner」目标,切换到「Debug」配置
    2. 「Signing Certificate」选择本地的「Apple Development」证书
    3. 「Provisioning Profile」设置为「Automatic」,若仍报错可直接选「None」(模拟器调试无需正式profile)
    4. 确认Bundle Identifier与项目一致,避免签名配置不匹配
  • 清理旧应用残留与项目缓存
    同Bundle Identifier的旧应用签名冲突是常见诱因:

    1. 在iOS模拟器中彻底删除该应用
    2. 执行以下命令清理项目:
      flutter clean
      cd ios
      pod deintegrate
      pod install
      cd ..
      flutter run
      
  • 适配Xcode 15的Flutter配置
    Flutter预览版与Xcode 15存在兼容性细节问题,修改Podfile:

    1. 打开ios/Podfile,在post_install块中添加Debug模式的签名豁免配置:
      post_install do |installer|
        installer.pods_project.targets.each do |target|
          flutter_additional_ios_build_settings(target)
          target.build_configurations.each do |config|
            if config.name == 'Debug'
              config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
              config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
            end
          end
        end
      end
      
    2. 重新执行pod install
  • 重置Xcode签名缓存
    若以上步骤无效,重置Xcode的签名相关缓存:

    1. 关闭Xcode与iOS模拟器
    2. 执行命令删除缓存:
      rm -rf ~/Library/Developer/Xcode/DerivedData
      rm -rf ~/Library/MobileDevice/Provisioning\ Profiles
      
    3. 重新打开Xcode,登录Apple ID,等待Xcode自动生成开发证书与临时配置文件

内容的提问来源于stack exchange,提问作者Mustafa Ismailjee

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.08 23:20:07