83

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

Calvin Ferrando
  • 3,794
  • 3
  • 16
  • 26

7 Answers7

176

If you are not on your Mac, you can get it through the iTunes connect website.

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

Eddie Groves
  • 33,851
  • 14
  • 47
  • 48
Martín De la Fuente
  • 6,155
  • 4
  • 27
  • 28
130

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.

Jordan
  • 4,133
  • 1
  • 27
  • 43
22

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.

KrauseFx
  • 11,551
  • 7
  • 46
  • 53
  • I've done that before and actually saw the `itc_team_id` for different teams but I'm building a NodeJS application where I run a `shell` command `fastlane` there. Basically, it is an automation build process where I don't need to answer/select the `itc_team_id` by just overwritting the Appfile and place the `itc_team_id` there. By the way, nice software you have. – Calvin Ferrando Mar 23 '17 at 04:08
  • 12
    If you are using fastlane deliver for example, do "fastlane deliver -u " and it will show the list of team ids for iTunes Connect – green0range Dec 04 '17 at 15:29
  • 1
    Is there any way to get the App Store Connect ID (not team id) without going through fastlane? I have an operations team that is not going to be running a cli to determine build parameters. I've scoured the internet for an answer to this.. no avail. Maybe you can shed some light @KrauseFx ? – Kelsey Apr 23 '19 at 00:56
9

Easiest way

fastlane produce

if you are in multiple teams it will show

[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)

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)
sultanmyrza
  • 4,551
  • 1
  • 30
  • 24
8

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

Datt Patel
  • 1,203
  • 1
  • 11
  • 10
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
Manuel Schmitzberger
  • 5,162
  • 3
  • 36
  • 45
4

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: 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

Note the select_team call above. It will show you the list of the teams you are on along with the itc_team_id

Tmac
  • 3,532
  • 2
  • 18
  • 9