Reputation: 38717
Previously, with Xcode 10, we were using altool
to upload to App Store:
ALTOOL="/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool"
"$ALTOOL" --upload-app --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password @keychain:"Application Loader: $APP_STORE_USERNAME"
But with Xcode 11, "Application Loader.app" doesn't exist anymore, as part of the Xcode 11 changes:
Xcode supports uploading apps from the Organizer window or from the command line with xcodebuild or xcrun altool. Application Loader is no longer included with Xcode. (29008875)
So how do we upload from command line to TestFlight or App Store now?
Upvotes: 55
Views: 33961
Reputation: 3342
Another way to validate/upload the .ipa without having to generate one time password every time:
Issuer ID
and KEY ID
.To validate run:
xcrun altool --validate-app -f {YOURAPP}.ipa -t ios --apiKey {YOUR KEY ID} --apiIssuer {YOUR ISSURE ID}
To upload to App Store run:
xcrun altool --upload-app -f {YOURAPP}.ipa -t ios --apiKey {YOUR KEY ID} --apiIssuer {YOUR ISSURE ID}
Upvotes: 3
Reputation: 3306
At least as of of Xcode 11, this can be done very easily and directly with xcodebuild, as part of the export workflow. Just create an exportOptions.plist file that specifies "upload" for the "destination" key and "app-store" for the "method" key. Here's an example, but of course tune to your needs:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<true/>
<key>destination</key>
<string>upload</string>
<key>method</key>
<string>app-store</string>
<key>provisioningProfiles</key>
<dict>
<key>YOUR_BUNDLE_ID</key>
<string>YOUR_PROFILE_NAME</string>
</dict>
<key>signingCertificate</key>
<string>YOUR_CERT_NAME</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>YOUR_TEAM_ID</string>
<key>thinning</key>
<string><none></string>
</dict>
</plist>
Once you have that, the command to upload an archive to app store connect is very simple, using the xcodebuild exportArchive command:
xcodebuild -exportArchive \
-archivePath PATH_TO_APP_ARCHIVE \
-exportPath OUTPUT_PATH \
-exportOptionsPlist exportOptions.plist
If you're wondering where your PATH_TO_ARCHIVE is, first just use the xcodebuild archive command, e.g.:
xcodebuild -sdk iphoneos \
-workspace myWorkspace.xcworkspace \
-scheme myScheme \
-configuration Release \
-archivePath PATH_TO_ARCHIVE archive
Upvotes: 12
Reputation: 935
You can now also use a new app from Apple called "Transporter" that is a replacement for Xcode application loader.
Upvotes: 7
Reputation: 560
Use command line tools,
xcrun altool --upload-app -f path -u username -p password
If your apple account use TWO-FACTOR Authentication , your password would be wrong , you need to go to https://appleid.apple.com/account/manage "Security - Generate Password"
to get the password
If you get other wrong , you could add --verbose
to print detail errors log, just like
xcrun altool --upload-app -f path -u username -p password --verbose
And , get more help with xcrun altool --help
Upvotes: 37
Reputation: 38717
With Xcode 11 as command line tools, to validate or upload an ipa, replace altool
with xcrun altool
:
xcrun altool --validate-app --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password @keychain:"Application Loader: $APP_STORE_USERNAME"
xcrun altool --upload-app --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password @keychain:"Application Loader: $APP_STORE_USERNAME"
Get more help with xcrun altool --help
.
Upvotes: 69