ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

fastlane sigh 怎么修复过期或损坏的 Provisioning Profile 并下载全部配置描述文件

fastlane sigh 怎么修复过期或损坏的 Provisioning Profile 并下载全部配置描述文件 fastlane sigh 怎么修复过期或损坏的 Provisioning Profile 并下载全部配置描述文件【免费下载链接】fastlane The easiest way to automate building and releasing your iOS and Android apps项目地址: https://gitcode.com/GitHub_Trending/fa/fastlane当团队里某个 App 的 Provisioning Profile 过期Expired或失效Invalid时逐个去 Apple Developer Portal 手工处理很耗时。fastlane 的sigh工具可以把这件事压缩成两条命令先用fastlane sigh repair把账号下所有过期或失效的 Profile 批量修复再用fastlane sigh download_all把全部有效的 Profile 下载到本地目录。本文按“修复 → 批量下载 → 本地核对 → 清理”的顺序给出完整操作路径。前提条件已安装 fastlane并且能够登录你的 Apple 开发者账号Apple ID 用户名/密码或通过 App Store Connect API Key账号属于多个团队时需要指定团队用-bteam ID或-lteam 名称或设置环境变量FASTLANE_ITC_TEAM_ID/FASTLANE_ITC_TEAM_NAME官方文档建议生成和维护 Provisioning Profile 推荐优先使用match参见 codesigning.guide直接上手sigh适合想要完全控制签名过程、且熟悉 codesigning 的场景。来源sigh 文档。第一步修复所有过期或失效的 Profilefastlane sigh repair这条命令会先以-u指定的用户名默认读Appfile中的apple_dev_portal_id/apple_id登录账号然后筛选出状态为Invalid或Expired的所有 Profile并逐个调用profile.repair!重建。实现见 repair.rb。执行后根据输出判断结果All provisioning profiles are valid, nothing to do账号下没有需要修复的 Profile流程结束Going to repair N provisioning profiles随后逐条出现Repairing profile name...最后输出Successfully repaired N provisioning profilesN 个 Profile 修复完成。第二步下载全部有效的 Profilefastlane sigh download_alldownload_all会拉取账号下所有有效的 Profile 并保存到-o指定的目录默认当前目录文件名按{profile_type}_{uuid}_{bundle_id}.mobileprovision命名tvOS 追加_tvosmacOS/Catalyst 使用.provisionprofile扩展名除非加了--skip_install下载后还会安装到本机的 Xcode provisioning profile 目录。实现见 download_all.rb。输出判断方式均为源码中的实际输出每个 Profile 会打印Downloading profile name...无效/过期的 Profile 会被跳过打印Skipping invalid/expired profile name没有任何可下载项时打印No profiles available for download。注意顺序download_all只下载有效 Profile失效的会被跳过。因此要拿到一份完整的新 Profile 集合应当先执行上一步的repair再执行本步骤。可选分支fastlane sigh download_all --download_xcode_profiles可以额外下载 Xcode 托管的 Profile但源码中标注该选项已废弃App Store Connect API 不支持查询 Xcode managed profiles不建议依赖。第三步用 manage 核对本地 Profilefastlane sigh managemanage会列出本机已安装的 Provisioning Profile并按有效期分成三组显示Valid:绿色有效期在 30 天之后的 ProfileExpiring within 30 days:黄色30 天内即将过期Expired:红色已过期。最后输出 Summary例如N installed profiles并统计过期与有效数量。如果存在过期 Profile会提示可以用fastlane sigh manage -e删除。这就是修复和下载完成后的验证依据确认目标 Profile 出现在Valid:列表中且 Summary 的安装总数符合预期。可选清理本地过期 Profilefastlane sigh manage -e副作用说明该命令会删除本地已安装的过期 Profile 文件。执行前会先列出将被删除的 Profile 名称并询问Delete these provisioning profiles N?确认后才删除成功时输出Deleted N profiles。在 CI 服务器上运行时manage的清理操作必须加--force否则会直接报错On a CI server, cleanup cannot be used without the --force option。也可以按正则表达式清理指定名称的 Profile同样会先列出并请求确认fastlane sigh manage -p iOS\ ?Team Provisioning Profile:实现见 local_manage.rb。边界与限制sigh从不读取或改动 Xcode 创建并托管的 Profile它只管理自己生成的那一批登录方式二选一Apple ID-u用户名或 App Store Connect API Keyapi_key_path指向 JSON 文件或api_key传 hash两者不能同时使用完整的参数与环境变量列表可以运行fastlane action sigh查看manage依赖解析本机 Profile 目录中的.mobileprovision文件因此核对步骤要安装在 Profile 的那台机器上执行。执行顺序不要颠倒先fastlane sigh repair处理坏掉的 Profile再fastlane sigh download_all把全部有效 Profile 拉到本地目录最后用fastlane sigh manage查看 Summary 核对安装数量确认没有落在Expired:分组里。【免费下载链接】fastlane The easiest way to automate building and releasing your iOS and Android apps项目地址: https://gitcode.com/GitHub_Trending/fa/fastlane创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表