Upload IPA with Application Loader from terminal

testflight
ios

#1

If you want to upload your IPA to iTunes Connect you can use the Deploy to iTunes Connect (with deliver) step for that.

However, there are some cases when you won’t be able to use this step:

  1. You can’t use it if you only have a Developer role on iTunes Connect.
  2. And right now, there is an issue if you have two-factor authentication enabled on your Apple Developer account.

#2

As an alternative, you can upload your IPA to TestFlight with the Application Loader from terminal.

  • It will not upload any metadata to iTunes Connect only the binary, and as a result it will work with a Developer role too.
  • And it’s working with two-factor authentication enabled as well:
  1. Just change the “Deploy to iTunes Connect” step to a “Script” step with this input:
#!/usr/bin/env bash
set -e
set -x

/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app -f "$BITRISE_IPA_PATH" -u "$LOADER_USER_NAME" -p "$LOADER_PASSWORD"
  1. Create a secret for $LOADER_USER_NAME and for $LOADER_PASSWORD with your iTunes Connect username and password.

#3

If you have two-factor authentication enabled on your Apple Developer account:

  1. You need to generate an app-specific password for this step (you will use this instead of your regular password):
    https://appleid.apple.com/account/manage
    Under Security, you can generate an “APP-SPECIFIC PASSWORD”.

  2. Use this generated app-specific password instead of your regular password in the secret env called $LOADER_PASSWORD.