What this guide covers
After reading, you can settle on a signing style for your project and know the matching options and export settings for command-line builds. You need: Xcode signed in to your developer account and a project that opens.
Steps
The short answer
- One person, clicking Archive and uploading in the graphical interface: use automatic signing.
- Command-line or CI builds, where you are the only one using the certificate: automatic signing plus an App Store Connect API key.
- Several people or several machines sharing one distribution certificate: manual signing, or fastlane match to distribute the signing material in one consistent way.
Neither is more "advanced". The only difference is who makes sure the certificate, the provisioning profile and the project settings all line up.
How to turn on automatic signing
Following Xcode Help: select the target in the project editor, click Signing & Capabilities, select "Automatically manage signing" under Signing, then pick your team from the Team menu.
From then on Xcode registers identifiers and creates certificates and provisioning profiles as needed. It depends on the account signed in to Xcode having a role with enough permissions; when it does not, the error shows directly on this page.
Automatic signing from the command line
By default
xcodebuilddoes not contact the developer portal. According to its built-in help, adding-allowProvisioningUpdateslets automatically signed targets create and update provisioning profiles, App IDs and certificates, provided a developer account is already in Xcode's Accounts settings, or you supply an App Store Connect key with these three options:-authenticationKeyPath <path to the .p8 file> -authenticationKeyID <Key ID> -authenticationKeyIssuerID <Issuer ID>On build machines we recommend the key, which does not depend on a sign-in session that expires.
How to set up manual signing
Prepare the distribution certificate (with its private key) and an App Store type provisioning profile, turn off automatic management in Signing & Capabilities, and select the matching profile for the Release configuration.
Spell it out in the export options file when exporting. According to
xcodebuild -help,signingStyletakesmanualorautomatic. For manual, useprovisioningProfilesto give the profile name or UUID for each Bundle ID, andsigningCertificateto name the certificate (an automatic selector such asApple Distributionis allowed).You are asked once more at distribution
When you click Distribute App in the Organizer, Apple's distribution documentation says distribution methods that involve signing ask you again to choose automatic management or manual signing. Archiving with a development certificate and having Xcode re-sign as a distribution build at distribution time is the normal flow under automatic signing.
What each style leaves behind on a remote Mac
Automatic signing: the certificate and private key are generated in this machine's keychain, and the sign-in session is stored in Xcode. Before the rental ends, export the .p12 and remove the account.
Also, according to Apple, development certificates belong to the individual, and the portal appends the computer name to the certificate name. So each time you move to another rented machine, the portal gains one more development certificate with a new computer name. After a rental ends, revoke the old machine's certificate in the portal so the list does not keep growing.
Manual signing: the machine holds only the .p12 and provisioning profiles you imported. When you change machines, import them again; nothing extra appears in the portal.
FAQ
Automatic signing says I have no permission to create a certificate. Why?
Most likely your role on the team cannot create distribution certificates. Ask the Account Holder or an Admin to create one and give you the .p12, or to change your role.
What do I do when a manually signed provisioning profile expires?
Go back to the developer portal, regenerate and download it, and replace the old file on the machine. A provisioning profile contains no private key, so regenerating it does not affect the certificate.
Do Flutter and other cross-platform projects have to choose too?
Yes. They all end up signing through an Xcode project, and the choice works exactly the same way. For how a cross-platform framework's own build commands pass signing settings along, go by each framework's official documentation.
Can I mix the two?
Yes, you can set them per target or per build configuration, for example automatic for Debug and manual for Release. If you mix them, write the rules into the project documentation so nothing is missed when you change machines.
Related
- How do I sign an iOS app and upload it to the App Store from a remote Mac?
- Sign in to Xcode with your Apple ID on a remote Mac: steps and the 2FA code
- How to create iOS certificates and profiles and back up the private key as .p12
- How to archive and export an ipa from the command line with xcodebuild
- Code signing hangs on a CI Mac: unlock the keychain or use a dedicated one
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support