What You'll Create
- Apple Distribution Certificate (
.p12) - App Store Provisioning Profile (
.mobileprovision) - App Store Connect API Key (
.p8)
이 콘텐츠는 아직 귀하의 언어로 제공되지 않습니다.
Complete guide to creating and exporting the iOS signing certificates and provisioning profiles required for building iOS apps with Capgo Cloud Build.
To build iOS apps, you need:
.p12 file) - Authenticates you as a developer.mobileprovision file) - Links your app, certificate, and devices.p8 file) - For automatic TestFlight/App Store submissionWhat You'll Create
.p12).mobileprovision).p8)Requirements
If you already have a distribution certificate installed on your Mac, export it as a .p12 file:
Open Keychain Access
Open Spotlight (Cmd + Space) and search for “Keychain Access”, or navigate to:
Applications → Utilities → Keychain Access
Find your certificate
In the sidebar, select login → My Certificates.
Look for a certificate named:
Apple Distribution: [Your Name/Company] (for App Store builds)Apple Development: [Your Name] (for development builds)Verify private key exists
Click the arrow next to the certificate to expand it. You should see a private key underneath.
Export as .p12
DistributionCertificate.p12)P12_PASSWORDSave the password securely
Store the password in a password manager. You’ll need it for Capgo builds.
If you don’t have a certificate yet, create one in the Apple Developer Portal:
Generate a Certificate Signing Request (CSR)
On your Mac, open Keychain Access and go to:
Keychain Access → Certificate Assistant → Request a Certificate From a Certificate Authority
Fill in the form:
Click Continue and save the .certSigningRequest file.
Create certificate in Apple Developer Portal
Go to Apple Developer Certificates and click the ”+” button.
Select the certificate type:
Click Continue.
Upload your CSR
Click “Choose File” and select the .certSigningRequest file you created.
Click Continue.
Download the certificate
Click Download to save the .cer file.
Install in Keychain
Double-click the downloaded .cer file. It will be added to your Keychain.
Export as .p12
Follow Option A above to export the newly installed certificate as a .p12 file.
The provisioning profile links your app ID, certificate, and (for development) devices.
Go to Provisioning Profiles
Visit Apple Developer Profiles and click the ”+” button.
Select profile type
Choose based on your build needs:
| Profile Type | Use Case |
|---|---|
| App Store Connect | Production builds for App Store/TestFlight |
| Ad Hoc | Internal testing on specific devices |
| iOS App Development | Development/debugging |
For Capgo Cloud Build release builds, select “App Store Connect”.
Click Continue.
Select your App ID
Choose your app from the dropdown list.
Click Continue.
Select your certificate
Check the box next to the distribution certificate you created/exported earlier.
Click Continue.
Name your profile
Enter a descriptive name, e.g., App Store - com.example.myapp
Click Generate.
Download the profile
Click Download to save the .mobileprovision file.
If you’ve already created provisioning profiles, you can find them locally:
# List all provisioning profiles on your Macls -la ~/Library/MobileDevice/Provisioning\ Profiles/
# Find the App ID for a specific profilesecurity cms -D -i ~/Library/MobileDevice/Provisioning\ Profiles/PROFILE_UUID.mobileprovision | grep -A 1 "application-identifier"Or download them again from Apple Developer Portal.
The API key enables automatic upload to TestFlight/App Store after building.
Go to App Store Connect
Visit App Store Connect and sign in.
Navigate to API Keys
Go to Users and Access → Integrations → App Store Connect API → Team Keys
Click the ”+” button to create a new key.
Configure the key
Capgo CI/CD)Click Generate.
Download the key
Click Download and save the file (named AuthKey_XXXXXXXXXX.p8).
Note the Key ID and Issuer ID
After downloading, you’ll see:
ABC1234567)00000000-0000-0000-0000-000000000000)Save both values - you’ll need them for configuration.
You may also need your Team ID for some configurations:
Now that you have all the files, save them for Capgo Cloud Build:
npx @capgo/cli build credentials save \ --platform ios \ --certificate ./DistributionCertificate.p12 \ --p12-password "YourP12Password" \ --provisioning-profile ./AppStore_com.example.myapp.mobileprovision \ --apple-key ./AuthKey_ABC1234567.p8 \ --apple-key-id "ABC1234567" \ --apple-issuer-id "00000000-0000-0000-0000-000000000000" \ --apple-team-id "TEAM123456"For CI/CD environments, encode files as base64 and set environment variables:
# Encode files to base64base64 -i DistributionCertificate.p12 | pbcopy # Certificatebase64 -i AppStore_com.example.myapp.mobileprovision | pbcopy # Profilebase64 -i AuthKey_ABC1234567.p8 | pbcopy # API KeySet these environment variables in your CI/CD secrets:
| Variable | Description |
|---|---|
BUILD_CERTIFICATE_BASE64 | Base64-encoded .p12 certificate |
BUILD_PROVISION_PROFILE_BASE64 | Base64-encoded .mobileprovision profile |
P12_PASSWORD | Password for the .p12 file |
APPLE_KEY_CONTENT | Base64-encoded .p8 API key |
APPLE_KEY_ID | App Store Connect API Key ID |
APPLE_ISSUER_ID | App Store Connect Issuer ID (UUID) |
APP_STORE_CONNECT_TEAM_ID | Your Apple Team ID |
Test that everything is configured correctly:
# List saved credentialsnpx @capgo/cli build credentials list
# Run a test buildnpx @capgo/cli build com.example.app --platform ios --build-mode debugCause: You exported only the certificate, not the certificate + private key pair.
Solution: In Keychain Access, expand the certificate to show the private key, select both items, then export.
Cause: The provisioning profile was created with a different certificate.
Solution:
Cause: Profile may be expired or revoked.
Solution:
Cause: Invalid API key credentials.
Solution:
APPLE_KEY_ID matches the Key ID shown in App Store ConnectAPPLE_ISSUER_ID is the UUID shown at the top of the API keys page.p8 file content is correctly base64-encodedCause: The certificate type doesn’t match the build type.
Solution:
| Certificate Type | Use | Provisioning Profile |
|---|---|---|
| Apple Development | Testing on devices | iOS App Development |
| Apple Distribution | App Store, TestFlight, Ad Hoc | App Store Connect, Ad Hoc |