Managing Credentials
Manage your iOS and Android build credentials locally for convenient cloud builds.
Overview
Section titled “Overview”Capgo CLI allows you to save build credentials locally on your machine in the .capgo-credentials folder. When you run a build, these credentials are automatically used and sent securely to Capgo’s build servers.
Commands
Section titled “Commands”Save Credentials
Section titled “Save Credentials”Store your build credentials locally for automatic use:
npx @capgo/cli build credentials save --platform <ios|android> [options]List Credentials
Section titled “List Credentials”View currently saved credentials (passwords are masked):
npx @capgo/cli build credentials listClear Credentials
Section titled “Clear Credentials”Remove saved credentials from your local machine:
# Clear all credentialsnpx @capgo/cli build credentials clear
# Clear only iOS credentialsnpx @capgo/cli build credentials clear --platform ios
# Clear only Android credentialsnpx @capgo/cli build credentials clear --platform androidSaving iOS Credentials
Section titled “Saving iOS Credentials”Complete Example
Section titled “Complete Example”npx @capgo/cli build credentials save \ --platform ios \ --certificate ./cert.p12 \ --p12-password "YourP12Password" \ --provisioning-profile ./profile.mobileprovision \ --apple-key ./AuthKey_ABC1234567.p8 \ --apple-key-id "ABC1234567" \ --apple-issuer-id "00000000-0000-0000-0000-000000000000" \ --apple-team-id "TEAM123456"iOS Options
Section titled “iOS Options”| Option | Description | Required |
|---|---|---|
--certificate <path> | Path to .p12 certificate file | Yes (release) |
--p12-password <password> | Password for the .p12 certificate | Yes (release) |
--provisioning-profile <path> | Path to .mobileprovision file | Yes (release) |
--provisioning-profile-prod <path> | Production provisioning profile (optional) | No |
--apple-key <path> | Path to App Store Connect API .p8 key | Yes (submission) |
--apple-key-id <id> | App Store Connect API Key ID | Yes (submission) |
--apple-issuer-id <id> | App Store Connect API Issuer ID (UUID) | Yes (submission) |
--apple-team-id <id> | App Store Connect Team ID | Yes (submission) |
--apple-id <email> | Apple ID email (alternative auth) | No |
--apple-app-password <password> | App-specific password (alternative auth) | No |
What Gets Stored
Section titled “What Gets Stored”When you save iOS credentials, the CLI:
- Reads the certificate and provisioning profile files
- Converts them to base64 encoding
- Saves the credentials to the
.capgo-credentialsfolder - Stores passwords and IDs as plain text (local files only)
The stored file structure:
{ "ios": { "BUILD_CERTIFICATE_BASE64": "...", "BUILD_PROVISION_PROFILE_BASE64": "...", "APPLE_KEY_CONTENT": "...", "P12_PASSWORD": "...", "APPLE_KEY_ID": "ABC1234567", "APPLE_ISSUER_ID": "...", "APP_STORE_CONNECT_TEAM_ID": "TEAM123456" }}Saving Android Credentials
Section titled “Saving Android Credentials”Complete Example
Section titled “Complete Example”npx @capgo/cli build credentials save \ --platform android \ --keystore ./release.keystore \ --keystore-alias "my-key-alias" \ --keystore-key-password "KeyPassword123" \ --keystore-store-password "StorePassword123" \ --play-config ./play-store-service-account.jsonAndroid Options
Section titled “Android Options”| Option | Description | Required |
|---|---|---|
--keystore <path> | Path to .keystore or .jks file | Yes (release) |
--keystore-alias <alias> | Key alias in the keystore | Yes (release) |
--keystore-key-password <password> | Password for the key alias | Yes (release) |
--keystore-store-password <password> | Password for the keystore | Yes (release) |
--play-config <path> | Path to Play Store service account JSON | Yes (submission) |
What Gets Stored
Section titled “What Gets Stored”When you save Android credentials, the CLI:
- Reads the keystore and service account JSON files
- Converts them to base64 encoding
- Saves the credentials to the
.capgo-credentialsfolder - Stores passwords and alias as plain text (local files only)
The stored file structure:
{ "android": { "ANDROID_KEYSTORE_FILE": "...", "PLAY_CONFIG_JSON": "...", "KEYSTORE_KEY_ALIAS": "my-key-alias", "KEYSTORE_KEY_PASSWORD": "...", "KEYSTORE_STORE_PASSWORD": "..." }}}Using Saved Credentials
Section titled “Using Saved Credentials”Once you’ve saved credentials, they’re automatically used when you build:
# Credentials automatically loaded from .capgo-credentials foldernpx @capgo/cli build com.example.app --platform iosYou can also override saved credentials using environment variables:
# Environment variables take precedence over saved credentialsBUILD_CERTIFICATE_BASE64="..." \P12_PASSWORD="different-password" \npx @capgo/cli build com.example.app --platform iosPrecedence order:
- Environment variables (highest priority)
- Saved credentials in
.capgo-credentialsfolder - No credentials (lowest priority)
Viewing Saved Credentials
Section titled “Viewing Saved Credentials”List what credentials you have saved:
npx @capgo/cli build credentials listExample output:
📋 Saved Build Credentials:
iOS Credentials: ✓ Certificate (base64) ✓ Provisioning Profile (base64) ✓ Apple Key Content (base64) ✓ P12 Password: ******** ✓ Apple Key ID: ABC1234567 ✓ Apple Issuer ID: 00000000-0000-0000-0000-000000000000 ✓ Team ID: TEAM123456
Android Credentials: ✓ Keystore (base64) ✓ Play Store Config (base64) ✓ Keystore Alias: my-key-alias ✓ Key Password: ******** ✓ Store Password: ********
Location: .capgo-credentials/
🔒 These credentials are stored locally on your machine only. When building, they are sent to Capgo but NEVER stored there. They are auto-deleted after build completion (max 24 hours).Security Best Practices
Section titled “Security Best Practices”Local Storage Security
Section titled “Local Storage Security”-
File Permissions
Terminal window # Ensure credentials folder is not readable by otherschmod 700 .capgo-credentialschmod 600 .capgo-credentials/* -
Never Commit Credentials
Terminal window # Add to .gitignoreecho ".capgo-credentials/" >> .gitignore -
Separate Credentials
- Use different credentials for local development vs CI/CD
- Rotate credentials regularly
- Don’t share credentials between team members
CI/CD Usage
Section titled “CI/CD Usage”For CI/CD environments, prefer environment variables over saved credentials:
# GitHub Actionsenv: BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_CERTIFICATE }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} # ... other secretsThis is more secure because:
- Secrets are managed by your CI/CD platform
- No credential files on runners
- Easy rotation and access control
- Audit trails for secret usage
Credential Rotation
Section titled “Credential Rotation”Regularly rotate your credentials:
- iOS: Generate new certificates and API keys yearly
- Android: Change keystore passwords annually
- After team changes: Rotate when team members leave
Update saved credentials:
# Re-run save command with new credentialsnpx @capgo/cli build credentials save --platform ios --certificate ./new-cert.p12 ...Troubleshooting
Section titled “Troubleshooting””No credentials found”
Section titled “”No credentials found””If the build says no credentials were found:
-
Check if credentials are saved:
Terminal window npx @capgo/cli build credentials list -
Save credentials if missing:
Terminal window npx @capgo/cli build credentials save --platform ios ... -
Verify credentials folder exists:
Terminal window ls -la .capgo-credentials/
“Permission denied” when reading credentials
Section titled ““Permission denied” when reading credentials”Fix file permissions:
chmod 700 .capgo-credentialschmod 600 .capgo-credentials/*Credentials not being used
Section titled “Credentials not being used”Check that the correct platform is specified:
# Make sure --platform matches saved credentialsnpx @capgo/cli build com.example.app --platform ios # Uses ios credentialsnpx @capgo/cli build com.example.app --platform android # Uses android credentialsClear and re-save credentials
Section titled “Clear and re-save credentials”If credentials seem corrupted:
# Clear all credentialsnpx @capgo/cli build credentials clear
# Save againnpx @capgo/cli build credentials save --platform ios ...Migration from Environment Variables
Section titled “Migration from Environment Variables”If you’re currently using environment variables, you can migrate to saved credentials:
-
Extract your current environment variables
Terminal window echo $BUILD_CERTIFICATE_BASE64 # Verify they exist -
Decode base64 files back to original files (if needed)
Terminal window echo "$BUILD_CERTIFICATE_BASE64" | base64 -d > cert.p12echo "$BUILD_PROVISION_PROFILE_BASE64" | base64 -d > profile.mobileprovision -
Save using the CLI
Terminal window npx @capgo/cli build credentials save \--platform ios \--certificate ./cert.p12 \--provisioning-profile ./profile.mobileprovision \--p12-password "$P12_PASSWORD" \--apple-key-id "$APPLE_KEY_ID" \--apple-issuer-id "$APPLE_ISSUER_ID" \--apple-team-id "$APP_STORE_CONNECT_TEAM_ID" -
Test the build
Terminal window npx @capgo/cli build com.example.app --platform ios -
Remove environment variables (optional)
Terminal window unset BUILD_CERTIFICATE_BASE64 BUILD_PROVISION_PROFILE_BASE64
File Location
Section titled “File Location”Credentials are stored in the .capgo-credentials folder:
- macOS/Linux:
.capgo-credentials/(in your project root or home directory) - Windows:
.capgo-credentials\(in your project root or home directory)
The folder is automatically created when you save credentials for the first time.
Next Steps
Section titled “Next Steps”- Getting Started - Create your first build
- iOS Builds - iOS-specific build configuration
- Android Builds - Android-specific build configuration
- Troubleshooting - Common issues and solutions
Need Help?
Section titled “Need Help?”- 📚 Troubleshooting guide
- 💬 Discord community
- 📧 Email: support@capgo.app