fastlane: team_id does not automatically select correct team when provisioning in iTunes Connect

Issue Description

My Apple ID belongs to two teams. I have specified the team_id I wish to use in my Appfile. It seems that there is no matching between the team_id and the iTunes Connect access corresponding to the team.

I searched for some way to indicate the correct iTunes Connect id (which is different from the team_id), but did not find one.

Unexpected output when running fastlane
Confusingly, I got this prompt even though I specified a team_id in my Appfile:

Multiple iTunes Connect teams found, please enter the number of the team you want to use:

1) "xxxxx" (2*******)
2) "yyyyy" (1******)

Configuration Files

Fastfile is copied directly from doc, only using :provision for the moment; there is one team_id specified in the Appfile and I’m not doing anything fancy.

Environment

fastlane 1.81.0

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)?

NO

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? NO

System ruby: ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

All gems up to date.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 51 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@biolinh in reply to your unanswered question:

as @ssteinerx said:

The thing is, the team_id and the iTunes Connect ids are not the same; should there be two different ones in the Appfile? Both of values of them are not same. I can find the team id in Membership tab in Apple Developer Account, but I dont know where find iTunes Connect ids ? Have tried http://apple.stackexchange.com/a/158151 but it isn’t same as iTunes Connect teams.

I had a hard time to find out the iTunes Connect ids as well (thx apple for making this super hard to find out…), so I want to share my approach:

Hope these hints will help you and other people saving time while finding out the correct value for itc_team_id.

@KrauseFx and fastlane team: thx for solving this issue. We con confirm it works with the newest version 1.105.2 (and choosing the correct (!) iTunes Connect id when finally accomplished to find out…)

Yeah, you can already specify the Team ID for both the Dev Portal and for iTunes Connect, check out the docs here https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md

app_identifier "tools.fastlane.app"       # The bundle identifier of your app

apple_dev_portal_id "portal@company.com"  # Apple Developer Account
itunes_connect_id "tunes@company.com"     # iTunes Connect Account

team_id "Q2CBPJ58CA" # Developer Portal Team ID
itc_team_id "18742801" # iTunes Connect Team ID

@TKBurner thanks for giving us free support of Fastlane and telling the team to have more attention on this fix! 😃

Just as we have:

team_id "ABCDEFGHIJ"     #  Developer Portal Team ID

We should have:

itunes_connect_id "ABCDEFG"  # iTunes Connect ID

@TKBurner Basically itc_team_id work with gym, pilot but not with latest_testflight_build_number(). When I run latest_testflight_build_number() I got

[20:53:04]: --------------------------------------------
[20:53:04]: --- Step: latest_testflight_build_number ---
[20:53:04]: --------------------------------------------
Multiple iTunes Connect teams found, please enter the number of the team you want to use: 
1) "name 1" (11111)
2) "name 2" (22222)
3) "name 3" (33333)
4) "name 4" (44444)

thanks @TKBurner and @KrauseFx for your support 👍

If I may add a suggestion, I think it would be a cool addition to the docs that, if you are in two teams, you must specify both the team_id and itc_team_id at https://github.com/fastlane/fastlane/blob/505ce4f462a4d9083a5334c81a6aaac8fa302aee/fastlane/docs/Appfile.md When I was reading it for the first time I thought I only needed to choose one of the pairs, not both.

@ssteinerx Thanks! I’ll surface this with the team 👍

Hey everyone, I was doing a lot of experiments, and noticed some rough edges around how the team ID isn’t automatically converted from integer to strings, and how some actions have an inconsistent handling of the available teams.

I therefore pushed a bunch of PRs, that should fix all the issues you mentioned above:

The PRs are ready, as soon as they are reviewed and merged, we’ll publish new releases for all those tools 👍

@lfarah can you confirm that the team selection for iTunes Connect works for other tools (e.g. deliver, pilot), but not for latest_testflight_build_number?

Thanks everybody for all the information provided, I hope the above posted pull requests will solve all the remaining issues 🚀

@ssteinerx I can’t wait to see this fixed either and sorry that this is still affecting you. ❤️

@lfarah Thanks so much!

I added our community PR flag to this as well so we can make sure to get as many resources on this as possible. If anyone is interested in investigating we’d love to see that.

To make sure that I’m definitive on what I’m communicating to the team:

The action latest_test_flight_build_number is not inheriting team id, and this is causing it to fail to run autonomously. Is that correct?

Thanks again 👍 👍

@KrauseFx yes, I use update_fastlane @TKBurner ENV[“ITC_TEAM_ID”] = “118033180” didn’t work:

# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command

# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`

# If you want to automatically update fastlane if a new version is available:
update_fastlane

# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.97.2"

default_platform :ios
ENV["ITC_TEAM_ID"] = "118033180"

platform :ios do
  before_all do
    # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
    cocoapods
     ENV["ITC_TEAM_ID"] = "118033180"
    cocoapods
  end

  # 1 
  desc "Creating a code signing certificate and provisioning profile"
  # 2
  lane :provision do
    # 3 
    produce(
      itc_team_name: "118033180",
      app_name: 'farah.lucas.kodeo',
      language: 'English',
      app_version: '1.0',
      sku: '123abc'
    )
    # 4
    cert
    # 5
    sigh(force: true)
  end

  desc "Runs all the tests"
  lane :test do
    scan
  end

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    # match(type: "appstore") # more information: https://codesigning.guide

    increment_build_number({
      itc_team_id: "118033180",
      build_number: latest_testflight_build_number + 1
    })    
    gym(scheme: "Kodeo") # Build your app - more options available
    pilot

    # sh "your_script.sh"
    # You can also use other beta testing services here (run `fastlane actions`)
  end

  desc "Deploy a new version to the App Store"
  lane :appstore do
    # match(type: "appstore")
    # snapshot
    gym # Build your app - more options available
    deliver(force: true)
    # frameit
  end

  # You can define as many lanes as you want

  after_all do  |lane| 
    # This block is called, only if the executed lane was successful

    # slack(
    #   message: "Successfully deployed new App Update."
    # )
  end

  error do  |lane, exception| 
    # slack(
    #   message: exception.message,
    #   success: false
    # )
  end
end


# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

# fastlane reports which actions are used
# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer