【发布时间】:2017-08-15 02:21:32
【问题描述】:
我正在为 fastlane 写一个 Appfile,我的问题是我已经在 Apple 开发中心拥有 team_name 和 team_id,但我无法获得 @ 987654325@/itc_team_id。我正在与不同的团队合作。我如何得到它?任何指南都会很棒。谢谢
【问题讨论】:
标签: ios app-store-connect fastlane
我正在为 fastlane 写一个 Appfile,我的问题是我已经在 Apple 开发中心拥有 team_name 和 team_id,但我无法获得 @ 987654325@/itc_team_id。我正在与不同的团队合作。我如何得到它?任何指南都会很棒。谢谢
【问题讨论】:
标签: ios app-store-connect fastlane
不要尝试手动获取它,只需运行 fastlane 而不指定团队 ID。一旦需要选择,fastlane 将列出所有可用的 iTunes Connect 团队及其 ID,然后您可以存储此号码。
【讨论】:
itc_team_id,但我正在构建一个NodeJS应用程序,在那里我运行shell命令fastlane。基本上,这是一个自动化构建过程,我不需要通过覆盖 Appfile 并将itc_team_id 放在那里来回答/选择itc_team_id。顺便说一句,你有不错的软件。
您可以直接从 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
您将看到您的帐户所属的团队列表,以及该团队的数字表示。
【讨论】:
将以下车道代码添加到您的快车道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 和团队名称
注意:- 将 {appleID} 和 {applePassword} 替换为您的 Apple ID 和密码
【讨论】:
我正在使用 fastlane,一次登录管理多个帐户。
fastlane match
fastlane deliver
【讨论】:
如果您不在 Mac 上,可以通过 iTunes Connect 网站获取。
contentProvider 对象从associatedAccounts 数组中获取您的iTunes Connect id - 名为contentProviderId 的条目反映了iTunes Connect id,查找name 值以选择正确的值
来源:https://github.com/fastlane/fastlane/issues/4301#issuecomment-253461017
【讨论】:
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)
【讨论】:
我使用 Spaceship 游乐场。它易于使用,您不需要任何事先的项目设置。如果您在多个团队中工作并且需要定期获取 itc_team_id,您可以让 Playground 继续运行。
从外壳
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
【讨论】: