How to get iTunes connect Team ID and Team name?
I'm writing down an Appfile
for fastlane
, my problem is I already have the team_name
and team_id
in Apple Dev Center but I can't get the iTunes Connect ID
/itc_team_id
. I'm working with different team. How do I get it? Any guide would be great. Thanks
If you are not on your Mac, you can get it through the iTunes connect website.
- Login to App Store Connect (https://appstoreconnect.apple.com/)
- Get output (JSON) from (https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail)
- You can now get your iTunes Connect ids from the
associatedAccounts
array with the differentcontentProvider
objects - the entry namedcontentProviderId
reflects the iTunes Connect id, lookup for thename
value to pick the correct one
Source: https://github.com/fastlane/fastlane/issues/4301#issuecomment-253461017
You can get it directly from Spaceship (See the "Login" section) (https://github.com/fastlane/fastlane/blob/master/spaceship/docs/iTunesConnect.md)
Basically just type the following in a shell:
$ irb
irb> require "spaceship"
irb> Spaceship::Tunes.login("iTunesConnect_username", "iTunesConnect_password")
irb> Spaceship::Tunes.select_team
You'll be presented with a list of teams your account belongs to, along with the numerical representation for that team.
Instead of trying to get it manually, just run fastlane without specifying the team ID. Once the selection is required, fastlane will list all the available iTunes Connect teams and their IDs, and you can then store this number.
Add below lane code to your fastlane Fastfile
and run 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
Get iTunes connect Team ID and Team name from ItunesTeamNames
and DevTeamNames
files in fastlane folder
Note:- Replace {appleID}
and {applePassword}
with your apple id and password