App Store and TestFlight
Upload IPA files to TestFlight with xcrun altool and an App Store Connect key (.p8), with validation, release notes and Transporter as an alternative.
For iOS, the Build Station uploads the finished IPA to App Store Connect with xcrun altool. The tool comes with Xcode; you don’t need to install anything extra. To sign in, it needs an App Store Connect API key, a .p8 file.
Requirements
- Xcode is fully installed, not just the Command Line Tools.
- The app has been created in App Store Connect (Apps › +), with the same bundle ID as in the project.
- A preset with output type IPA (.ipa) builds a signed IPA. You set up signing and certificates in Xcode as usual; the Station doesn’t manage them.
Step by step
Open Projekt bearbeiten › Upload › Store-Upload einrichten (Edit project › Upload › set up store upload) and then the App Store tab.
- Create a team key. In App Store Connect › Users and Access › Integrations › App Store Connect API, create a team key with the App Manager role. altool doesn’t accept individual keys.
- Download the
.p8. You can do this only once. The key ID and issuer ID are on the same page. - Set it up. Switch on Direkt hochladen (xcrun altool mit API-Schlüssel) (upload directly, xcrun altool with API key), choose the
.p8and enter the Issuer-ID (issuer ID). The Station reads the Key-ID (key ID) from the file nameAuthKey_<KEY-ID>.p8. - Test the connection. The test asks App Store Connect for the app matching the bundle ID. It doesn’t change anything.
Übernehmen (apply) saves. The key is then stored in this Mac’s macOS keychain.
If your Apple account belongs to several teams, also enter the asc-provider in the project editor under Upload › iOS · App Store Connect.
Validating before the upload
Vor dem Upload validieren (validate before upload) is on by default. The Station then calls xcrun altool --validate-app before the upload. That costs a few minutes, but catches signing errors before Apple reports them by email.
Uploading
After a successful iOS build, the Hochladen (Upload) section shows the Jetzt hochladen · App Store Connect (altool) (upload now) button. The confirmation shows the exact commands. The upload runs through the queue and is listed in the history with its log.
For each call, the Station writes the .p8 from the keychain into a private temp folder that only your user can read, and deletes it again afterwards. A .p8 under ~/.appstoreconnect/private_keys/ works too.
After the upload, Apple’s processing takes a few more minutes until the build shows up in TestFlight. The upload was still successful.
Release notes for TestFlight
The Release Notes (optional) field in the confirmation goes to TestFlight as “What to Test”. This requires the Bundle-ID and Issuer-ID to be entered in the project; otherwise the field is disabled. Aus Commits vorschlagen (KI) (suggest from commits, AI) provides a draft from the commits since the last upload, see Artifacts and upload.
Without direct upload: Transporter
Without an upload set up, there’s still the route through Apple’s Transporter app:
- Drag the IPA by the handle on the left of the Hochladen section straight into the Transporter window.
- Or click Transporter: the Station opens the app, puts the IPA path on the clipboard and shows the file in the Finder. Then just hit “Deliver”.
App Store Connect opens the configured link, for example for processing and TestFlight release.
What’s in the store
With the key set up, the Station asks App Store Connect which build number was uploaded last. That’s shown in the Build tab and in the Übersicht (Overview), and the next build number is automatically above it.
In the Übersicht, the Station also shows when the app’s iOS distribution certificate and provisioning profiles expire. See Overview and work list.
Common errors
| Message | Cause |
|---|---|
Could not find the API key file |
The .p8 is neither in the keychain nor under ~/.appstoreconnect/private_keys/, or it isn’t named AuthKey_<KEY-ID>.p8. |
Unable to authenticate |
Key ID and issuer ID don’t belong together, or the key was revoked. |
| Upload successful, TestFlight shows nothing | Apple’s processing is still taking a few minutes. |
| Build number already taken | Increase the build number and rebuild. The Station already asks about this when you start the build. |
Mac apps
The same key also works for the Mac App Store and for notarizing macOS apps outside the store. See Distributing macOS apps.
Alternative: fastlane
If you need more than “upload a file”, such as your own workflows in a Fastfile, choose Eigene fastlane-Lane (custom fastlane lane) in the project editor. See fastlane.