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

时间:2017-03-22 19:09:34

标签: ios itunesconnect fastlane

我正在为 Appfile 写下fastlane,我的问题是我已经拥有Apple中的team_nameteam_id开发中心,但我无法获得iTunes Connect ID / itc_team_id 。我和不同的团队合作。我怎么得到它?任何指南都会很棒。感谢

6 个答案:

答案 0 :(得分:53)

您可以直接从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

您将看到您的帐户所属的团队列表,以及该团队的数字代表。

答案 1 :(得分:10)

如果您不在Mac上,则可以通过iTunes connect网站获得它。

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

答案 2 :(得分:8)

不要手动获取,只需运行 fastlane 而不指定团队ID。一旦需要选择, fastlane 将列出所有可用的iTunes Connect团队及其ID,然后您可以存储此号码。

答案 3 :(得分:4)

在车道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文件夹中的ItunesTeamNamesDevTeamNames文件中获取iTunes Connect团队ID和团队名称

注意:-用您的Apple ID和密码替换{appleID}{applePassword}

答案 4 :(得分:2)

最简单的方法

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)

答案 5 :(得分:0)

我正在使用快速通道,一次登录即可管理多个帐户。

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