如何获取iTunes Connect团队ID和团队名称?

86

我正在为fastlane编写一个Appfile,我的问题是我已经在苹果开发者中心中有了team_nameteam_id,但我无法获得/itc_team_id。 我正在与不同的团队合作。 我该如何获取它?任何指南都将非常感谢。谢谢。

7个回答

180

如果您不在自己的 Mac 上,您可以通过 iTunes Connect 网站获取它。

来源:https://github.com/fastlane/fastlane/issues/4301#issuecomment-253461017


2
2021年可用。应该将iTunes Store Connect重命名为App Store Connect,以便您与苹果的命名保持同步。 - Edgar Froes
这是最好的答案。在2021年也适用。特别是如果您启用了2fa。未来,可能会更容易使用fastlane和苹果。 - thinklinux
最佳答案。谢谢。 - KSR

131

您可以直接从 Spaceship 获取(请参见“登录”部分)(https://github.com/fastlane/fastlane/blob/master/spaceship/docs/iTunesConnect.md

基本上只需在 shell 中输入以下内容:

$ irb
irb> require "spaceship"
irb> Spaceship::Tunes.login("iTunesConnect_username", "iTunesConnect_password")
irb> Spaceship::Tunes.select_team
您将会看到一个您账户所属的团队列表,同时也会提供该团队的数字代表。

22

不要试图手动获取,只需在不指定团队ID的情况下运行fastlane。一旦需要选择,fastlane将列出所有可用的iTunes Connect团队及其ID,然后您可以存储这个数字。


我以前做过这个,实际上看到了不同团队的 itc_team_id,但我正在构建一个 NodeJS 应用程序,在那里运行一个 shell 命令 fastlane。基本上,这是一个自动化构建过程,我不需要通过覆盖 Appfile 并放置 itc_team_id 来回答/选择 itc_team_id。顺便说一下,你们的软件很好。 - Calvin Ferrando
12
如果您正在使用fastlane deliver,例如,请执行“fastlane deliver -u <account_user_name>”,它将显示iTunes Connect团队ID列表。 - green0range
1
有没有办法在不使用fastlane的情况下获取App Store Connect ID(而不是团队ID)?我有一个运营团队,他们不会运行cli来确定构建参数。我已经在互联网上搜索了答案..但是没有结果。也许你可以帮忙解决一下,@KrauseFx? - Kelsey

9

最简单的方法

fastlane produce

如果您在多个团队中,它将显示:

[16:36:43]: Your Apple ID Username: youremail@icloud.com
Available session is not valid any more. Continuing with normal login.
Multiple teams found on the Developer Portal, please enter the number of the team you want to use: 
1) 89******8K "B******d Incorporated" (Company/Organization)
2) B8******ZP "Sultanmyrza Kasymbekov" (Individual)

你应该选择一个后,它会再次询问你。

[16:38:19]: [DevCenter] App 'co.brainfood.brainfood' already exists, nothing to do on the Dev Center
Available session is not valid any more. Continuing with normal login.
Multiple App Store Connect teams found, please enter the number of the team you want to use: 
Note: to automatically choose the team, provide either the App Store Connect Team ID, or the Team Name in your fastlane/Appfile:
Alternatively you can pass the team name or team ID using the `FASTLANE_ITC_TEAM_ID` or `FASTLANE_ITC_TEAM_NAME` environment variable

  itc_team_id "1******12"

or

  itc_team_name "B******d Incorporated"

1) "B******d Incorporated" (1*******2)
2) "Sultanmyrza Kasymbekov" (1******7)

1
谢谢,这对我来说是最简单的获取方式。 - Eman

8

将下列代码添加到你的 Fastfile 中,然后运行 fastlane getTeamNames

 lane :getTeamNames do
  require "spaceship" 
  clientTunes = Spaceship::Tunes.login("{appleID}", "{applePassword}")
  client = Spaceship::Portal.login("{appleID}", "{applePassword}")

  strClientTunes = "" 
  clientTunes.teams.each do |team|
      UI.message "#{team['contentProvider']['name']} (#{team['contentProvider']['contentProviderId']})"
      strClientTunes << "#{team['contentProvider']['name']} (#{team['contentProvider']['contentProviderId']})||"
  end 
  File.write('ItunesTeamNames', strClientTunes[0..-3])

  strDevPortal = "" 
  client.teams.each do |team|
      UI.message "#{team['name']} (#{team['teamId']})"
      strDevPortal << "#{team['name']} (#{team['teamId']})||"
  end
  File.write('DevTeamNames', strDevPortal[0..-3])

end

从fastlane文件夹中的ItunesTeamNames和DevTeamNames文件中获取iTunes连接团队ID和团队名称。
注意:请用您的Apple ID和密码替换{appleID}和{applePassword}。

5

我正在使用Fastlane,通过一个登录来管理多个账户。

  • 为了获取所有的dev_team_id(开发者门户团队ID),我运行以下命令:
    fastlane match
  • 要获取所有c_team_id(App Store Connect 团队 ID),我运行以下命令:
    fastlane deliver

4
我使用Spaceship游乐场。它易于使用,您不需要进行任何先前的项目设置。如果您正在与许多团队共同工作,并且需要经常获取itc_team_id,则可以让Playground保持运行状态。
从shell中:
fastlane spaceship
[✔]  
[16:37:57]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
Username: you@youremail.com
Logging into to App Store Connect (you@youremail.com)...
Successfully logged in to App Store Connect

Logging into the Developer Portal (you@youremail.com)...
Successfully logged in to the Developer Portal

---------------------------------------
| Welcome to the spaceship playground |
---------------------------------------

Enter docs to open up the documentation
Enter exit to exit the spaceship playground
Enter _ to access the return value of the last executed command

Just enter the commands and confirm with Enter
[1] pry(#<Spaceship::Playground>)> Spaceship::Tunes.select_team

请注意上面的 select_team 调用。它将显示您所在团队的列表以及 itc_team_id。

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