Code Signing
Manage signing certificates and provisioning profiles for app distributionAutomate the management of signing certificates and provisioning profiles required for app distribution.
Overview
Code signing is required for:- App Store distribution
- Ad-hoc distribution
- Development builds
- Enterprise distribution
signing fetch command that:
- Resolves your bundle ID
- Finds matching certificates
- Locates or creates provisioning profiles
- Downloads everything to your local machine
Quick Start
Fetch Signing Assets for App Store
For App Store distribution:- Find your App Store distribution certificates
- Locate or create an App Store provisioning profile
- Download certificates as
.cerfiles - Download the provisioning profile as
.mobileprovision
Fetch Signing Assets for Development
For development builds (requires device IDs):Profile Types
iOS Profiles
- IOS_APP_STORE: App Store distribution
- IOS_APP_DEVELOPMENT: Development builds
- IOS_APP_ADHOC: Ad-hoc distribution
- IOS_APP_INHOUSE: Enterprise distribution
macOS Profiles
- MAC_APP_STORE: Mac App Store distribution
- MAC_APP_DEVELOPMENT: Mac development
- MAC_APP_DIRECT: Mac direct distribution
- MAC_CATALYST_APP_DEVELOPMENT: Mac Catalyst development
- MAC_CATALYST_APP_STORE: Mac Catalyst App Store
tvOS Profiles
- TVOS_APP_STORE: tvOS App Store
- TVOS_APP_DEVELOPMENT: tvOS development
- TVOS_APP_ADHOC: tvOS ad-hoc distribution
- TVOS_APP_INHOUSE: tvOS enterprise distribution
Complete Signing Workflow
1
Register your bundle ID (if new)
First-time setup for a new app:Verify it exists:
2
Register development devices (for development profiles)
For development and ad-hoc profiles, register test devices:List all registered devices:
3
Create certificates (if needed)
Generate a Certificate Signing Request (CSR) on your Mac:Upload the CSR to create a certificate:List existing certificates:
4
Fetch signing assets
Download everything at once:The output directory will contain:
5
Install certificates and profiles
Install the certificate (double-click or use CLI):Install the provisioning profile:Or double-click the
.mobileprovision file to install via Xcode.Automatic Profile Creation
If no matching profile exists, use--create-missing to automatically create one:
Certificate Management
List All Certificates
Filter by Type
Check Certificate Expiration
Revoke a Certificate
Provisioning Profile Management
List Profiles
Get Profile Details
Download a Specific Profile
Delete a Profile
CI/CD Integration
GitHub Actions Example
GitLab CI Example
Advanced Usage
Filter Certificates by Type
When fetching, you can filter which certificates to download:Fetch for Multiple Bundle IDs
For apps with multiple targets:Verify App Association
Ensure the bundle ID matches your app:Troubleshooting
”No certificates found”
Problem: No distribution certificates exist for the account. Solution: Create a new certificate:- Generate CSR in Keychain Access
- Create certificate:
“Bundle ID not found”
Problem: The bundle identifier doesn’t exist in App Store Connect. Solution: Register the bundle ID:“Device IDs required for development profiles”
Problem: Development profiles require registered devices. Solution: Register devices and include their IDs:“Failed to create profile”
Problem: Profile creation failed due to missing prerequisites. Solution: Verify requirements:- Bundle ID exists
- Valid certificates exist
- For development: devices are registered
- Account has necessary permissions
Certificate Not Installing
Problem: Double-clicking the.cer file doesn’t import the certificate.
Solution: Use the security command:
Best Practices
- Automate certificate renewal: Set up alerts for expiring certificates (they expire after 1 year)
- Use different certificates for different environments: Separate development and distribution certificates
- Protect private keys: Never commit certificates or private keys to version control
- Use CI/CD secrets: Store API keys and certificates as encrypted secrets in your CI/CD platform
- Regenerate profiles after certificate renewal: When you renew certificates, regenerate all associated profiles
- Keep device lists updated: Regularly add new test devices and remove old ones
-
Use
--create-missingin CI: Ensures profiles are created if they don’t exist - Clean up old profiles: Delete unused profiles to avoid confusion
Related Commands
- Bundle IDs - Manage bundle identifiers
- Certificates - Manage signing certificates
- Devices - Register test devices
- Profiles - Manage provisioning profiles