iOS code signing
iOS builds are signed with a distribution certificate and a provisioning profile. With an App Store Connect API key, AppRelease takes care of both.
Requirements
- An Apple Developer Program membership.
- The app's bundle identifier registered under Certificates, Identifiers & Profiles → Identifiers.
- An App Store Connect API key with
App Manageraccess (steps below).
Creating the App Store Connect API key
- Log in to App Store Connect and go to Users and Access → Integrations → App Store Connect API.
- Click + next to Active keys.
- Name the key (for example "AppRelease") and choose the
App Managerrole. - Click Generate, then Download API Key. The
.p8file can only be downloaded once. - Note the Issuer ID above the table and the Key ID in the row.
Adding the key to AppRelease
- In the console open Credentials → Add credential → App Store Connect API key.
- Pick the
.p8file, enter the Key ID and the Issuer ID. - Click Save. The key is encrypted and never shown again; the runner uses it for signing, for the build number and for the upload.
Automatic signing
Before the scripts run, the runner asks App Store Connect for a distribution certificate (creating one if there is none that AppRelease holds the private key for) and for a provisioning profile matching the bundle identifier and distribution type. Both are installed into a temporary keychain that is deleted when the build ends.
workflows:
ios-workflow:
environment:
ios_signing:
distribution_type: app_store # app_store | ad_hoc | development
bundle_identifier: com.example.appApps with more than one target (an extension, a watch app) list every identifier:
ios_signing:
distribution_type: app_store
bundle_identifier:
- com.example.app
- com.example.app.widgetManual signing
Not needed and not supported: with the API key in place, Xcode resolves the certificate and the provisioning profile itself, for App Store, ad hoc and development builds alike. There is nothing to upload besides the key.
Export options
Either way the runner writes an export options plist and exposes it as AR_EXPORT_OPTIONS. Pass it to the build:
flutter build ipa --release --export-options-plist="v">$AR_EXPORT_OPTIONSThe runner also sets AR_CERTIFICATE_NAME, AR_PROVISIONING_PROFILE and AR_TEAM_ID, should a custom Xcode step need them.
Troubleshooting
| Message | Usually means |
|---|---|
| No profiles for 'com.example.app' were found | The bundle identifier in ios_signing does not match the one in Xcode, or is not registered in the developer portal. |
| Provisioning profile doesn't include signing certificate | Manual signing with a profile made for a different certificate. Regenerate the profile, or switch to automatic signing. |
| Authentication credentials are missing or invalid | The API key was revoked, or Issuer ID and Key ID were swapped. |