How to upload an iOS app to the app store via command line

Viewed 21446

As part of the countinues integration process of my iPhone application, I want to create a process that will automatically upload the app (.ipa) file to the apple app store. I already managed to create the package and validate it. Is there a way to upload the ipa file to the appstore via command line?

5 Answers

UPLOAD IPA TO TESTFLIGHT

altool --upload-app -f "${APP_NAME}.ipa" -u $APP_STORE_USERNAME -p $APP_STORE_PASSWORD

To use altool from anywhere in the terminal you could add it to your PATH env variable by typing in terminal:

Previous to Xcode 11:

MacBook-Pro:~ denis$ export PATH=$PATH:/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/
MacBook-Pro:~ denis$ source ~/.bash_profile

From Xcode 11 and later: (altool has changed location)

MacBook-Pro:~ denis$ export PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin/
MacBook-Pro:~ denis$ source ~/.bash_profile

You can try using Transporter directly to get away from fastlane if desired. It can also be installed on any OS so container based (docker) uploads are theoretically possible.

Once you have it setup try something like:

iTMSTransporter -m upload -u <usename_email> -p <password> -k 10000 -itc_provider <provider_id> -assetFile MyApp.ipa -assetDescription AppStoreInfo.plist

The provider ID is something you will need to look up using the transporter's -m provider command

Related