Fastlane Match如何在多个团队和多个Bundle ID之间进行匹配?

9
我有一个Xcode项目,其中包含多个目标。其中两个目标生成应用程序,并具有各自的bundle id,以通过企业开发团队ID进行分发,而另一个目标则通过App Store开发人员团队ID进行分发。我正在尝试为此项目设置Fastlane Match,但我无法使其处理多个团队。
这里是我的Matchfile的内容:
git_url("git@github.com:myorg/certificates-repo.git")
git_branch("master")

app_identifier([
    "my.app.prod",   # <-- Team ID A
    "my.app.dev",    # <-- Team ID B
    "my.app.staging" # <-- Team ID B
])

clone_branch_directly(true)

我的 Appfile 文件:

team_id "Team ID B"
apple_id "my@apple.id"

在命令行中运行fastlane match以初始化Fastlane Match时,我遇到了以下错误:
==========================================
Could not find App ID with bundle identifier 'my.app.prod'
You can easily generate a new App ID on the Developer Portal using 'produce':

fastlane produce -u my@apple.id -a my.app.prod --skip_itc

You will be asked for any missing information, like the full name of your app
If the app should also be created on App Store Connect, remove the --skip_itc from the command above
==========================================

An app with that bundle ID needs to exist in order to create a provisioning profile for it

这是有道理的,因为它不知道团队ID A。我能否调整Fastlane Match,使其在多个应用程序标识符中与我的两个团队ID都相容?

1个回答

3
您可以使用环境变量
  • 创建两个名为.env.target1.env.target2的文件。
  • 在这两个文件中使用相应的值定义MATCH_APP_IDENTIFIERFASTLANE_TEAM_IDMATCH_USERNAME。您可以使用.env.env.default文件共享值以避免重复,或将它们留在您的Matchfile/Appfile中。
  • 在您的Fastfile中定义一个使用match的lane。†
  • 使用以下命令执行match:fastlane <lane-name> --env target1

lane :<lane-name> do
    match()
end

当从命令行运行fastlane match来初始化match和证书存储库时,会出现错误消息。当从车道中运行match时,它会获取证书。我还没有完全理解。现在有一个澄清的问题。 - Mikkel Selsøe
@MikkelSelsøe 你尝试过使用一支球队的详细信息初始化Match,然后使用我的建议解决方案吗? - Francesco Puglisi
我最终使用证书存储库中每个团队一个分支的方法解决了这个问题,如此处所述:https://docs.fastlane.tools/actions/match/#multiple-teams - Mikkel Selsøe

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接