Adding the Code signing certificate for iOS
Codemagic lets you upload code signing certificates as PKCS#12 archives containing both the certificate and the private key which is needed to use it. When uploading, Codemagic will ask you to provide the certificate password (if the certificate is password-protected) along with a unique Reference name, which can then be used in the codemagic.yaml
configuration to fetch the specific file.
- Open your Codemagic Team settings, go to codemagic.yaml settings > Code signing identities.
- Open iOS certificates tab.
- Upload the certificate file by clicking on Choose a .p12 or .pem file or by dragging it into the indicated frame.
- Enter the Certificate password and choose a Reference name.
- Click Add certificate
If you have added the App Store Connect API key to Codemagic, you can also generate a new Apple Development
or Apple Distribution
certificate.
- Open your Codemagic Team settings, go to codemagic.yaml settings > Code signing identities.
- Open iOS certificates tab.
- Click Generate certificate.
- Provide a Reference name for the certificate.
- Choose the Certificate type.
- Select the App Store Connect API key to use.
- Click Create certificate.
Once the certificate has been created, Codemagic will allow you to download the certificate and provides the password for it.
After downloading, please follow the steps in the Upload certificate tab to upload the certificate to Codemagic.
Note: Apple limits the number of Apple Distribution
certificates to 3. If you have already reached the maximum number of certificates, the following error will be displayed:
There is a problem with the request entity - You already have a current Distribution certificate or a pending certificate request.
Similar errors can also arise in rarer cases with Apple Development
certificates. To resolve the error, either remove some old certificate from the Apple Developer Portal or upload an existing certificate manually.
Existing signing certificates previously generated by Codemagic can be automatically fetched from Apple Developer Portal based on your team’s App Store Connect API key.
Fetching a certificate that was not generated by Codemagic is not possible because each certificate is linked with a private signing key to which Codemagic has no access.
- Open your Codemagic Team settings, go to codemagic.yaml settings > Code signing identities.
- Open iOS certificates tab.
- Click Fetch certificate.
- Select a certificate from the Development certificates or Distribution certificates list.
- Click Fetch selected.