'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
Solution 1:[1]
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
associatedAccountsarray with the differentcontentProviderobjects - the entry namedcontentProviderIdreflects the iTunes Connect id, lookup for thenamevalue to pick the correct one
Source: https://github.com/fastlane/fastlane/issues/4301#issuecomment-253461017
Solution 2:[2]
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.
Solution 3:[3]
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
Solution 4:[4]
Easiest way
fastlane produce
if you are in multiple teams it will show
[16:36:43]: Your Apple ID Username: [email protected]
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)
you should choose one after it will as you again
[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)
Solution 5:[5]
I'm using fastlane, managing multiple accounts with one login.
- To get all dev_team_ids (Developer Portal Team ID), I run the following command:
fastlane match
- To get all c_team_ids (App Store Connect Team ID), I run the following command:
fastlane deliver
Solution 6:[6]
I use the Spaceship playground. It is easy to use and you don't need any prior project setup. If you are working on a lot of teams and need to get the itc_team_id on a regular basis, you can leave the Playground running.
From 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: [email protected]
Logging into to App Store Connect ([email protected])...
Successfully logged in to App Store Connect
Logging into the Developer Portal ([email protected])...
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
Note the select_team call above. It will show you the list of the teams you are on along with the itc_team_id
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Eddie Groves |
| Solution 2 | KrauseFx |
| Solution 3 | Datt Patel |
| Solution 4 | sultanmyrza |
| Solution 5 | Manuel Schmitzberger |
| Solution 6 | Tmac |
