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

如何通过fastlane生成适配离线调试的Provisioning Profile

解决Xcode离线调试与fastlane/match自动化管理冲突问题

问题说明

  • 项目需要在网络不稳定的环境下开展日常测试和调试,但默认Xcode调试器仅支持联网使用——这是因为Apple开发者门户中的Provisioning Profile默认未开启离线模式:
    Provisioning Profile离线模式设置
  • 手动在开发者门户开启离线模式后,可正常进行离线调试,但这类配置文件仅7天有效期;且我使用fastlane/match自动管理配置文件,手动修改门户设置违背自动化初衷,同时未在match的lane配置中找到管理该标识的选项。

可行方案

1. 用fastlane自动生成支持离线调试的配置文件

fastlane的sigh工具(match底层依赖该工具)支持生成带离线权限的Provisioning Profile,只需添加allow_offline_use: true参数即可。如果使用match,可通过additional_cert_args传递该参数:

lane :match_development_offline do
  match(
    type: "development",
    additional_cert_args: "--allow-offline-use"
  )
end

若直接调用sigh,写法如下:

lane :generate_offline_profile do
  sigh(
    allow_offline_use: true,
    type: "development"
  )
end

2. 自动处理7天有效期问题

由于离线模式配置文件有效期固定为7天,可将生成配置的lane加入CI/CD定时任务,每周自动执行一次,实现配置文件自动续期,无需手动操作。

验证方法

  • 执行上述lane后,前往Apple开发者门户确认对应Provisioning Profile已开启"Allow offline use"标识
  • 将设备断网,启动Xcode调试会话,确认可正常进行离线调试

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.25 15:13:24