fastlane deliver で Multiple App Store Connect Teams found; unable to choose, terminal not interactive! が出た時の解決方法

CircleCI 上で実行した $ fastlane deliver

Multiple App Store Connect Teams found; unable to choose, terminal not interactive!

というエラーが出た。

先に結論を述べると、職場で利用している Apple Developer Program のアカウントが複数のチームに紐付いていたのが原因だった。 最近 Enterprise アカウントを作成したことの副作用で発生した出来事だった。

解決方法としては、deliver のパラメータに Team ID を明示的に渡してやる。Deliverfile に書いてやるのが簡潔で良い。 ちなみに自分のプロジェクトで使っている Deliverfile は以下の通り。内容は一部改変している。

app_identifier “jp.foo.bar"
username “buz@example.com"
team_id “xxxxxxxxxxx"
force false
skip_screenshots true
skip_metadata true
skip_binary_upload false
automatic_release false

ちなみに1点気をつけることがあり、この時 Team ID として入力するのは、 Developer Program で確認できる 10 桁の Team ID ではなく、 Spaceship で取得できる数値。 fastlane が実行できる環境であれば、irb も Spaceship を使えると思う。以下のように取得する。

$ irb
irb> require "spaceship"
irb> Spaceship::Tunes.login("iTunesConnect_username", "iTunesConnect_password")
irb> Spaceship::Tunes.select_team

環境

  • Ruby 2.3.1
  • fastlane 2.113.0

参考