Managing Credentials
Manage your iOS and Android build credentials locally for convenient cloud builds.
Overview
Capgo CLI allows you to save build credentials locally on your machine in ~/.capgo/credentials.json. When you run a build, these credentials are automatically used and sent securely to Capgoโs build servers.
Commands
Save Credentials
Store your build credentials locally for automatic use:
npx @capgo/cli build credentials save --platform <ios|android> [options]List Credentials
View currently saved credentials (passwords are masked):
npx @capgo/cli build credentials listClear 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
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
| 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
When you save iOS credentials, the CLI:
- Reads the certificate and provisioning profile files
- Converts them to base64 encoding
- Saves the base64 strings to
~/.capgo/credentials.json - Stores passwords and IDs as plain text (local file 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
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
| 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
When you save Android credentials, the CLI:
- Reads the keystore and service account JSON files
- Converts them to base64 encoding
- Saves the base64 strings to
~/.capgo/credentials.json - Stores passwords and alias as plain text (local file 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
Once youโve saved credentials, theyโre automatically used when you build:
# Credentials automatically loaded from ~/.capgo/credentials.jsonnpx @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/credentials.json - No credentials (lowest priority)
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.json
๐ 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
Local Storage Security
-
File Permissions
Terminal window # Ensure credentials file is not readable by otherschmod 600 ~/.capgo/credentials.json -
Never Commit Credentials
Terminal window # Add to .gitignoreecho ".capgo/" >> .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
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
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
โ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 file exists:
Terminal window cat ~/.capgo/credentials.json
โPermission deniedโ when reading credentials
Fix file permissions:
chmod 600 ~/.capgo/credentials.jsonCredentials 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
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
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
Credentials are stored at:
- macOS/Linux:
~/.capgo/credentials.json - Windows:
%USERPROFILE%\.capgo\credentials.json
The file is automatically created when you save credentials for the first time.
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?
- ๐ Troubleshooting guide
- ๐ฌ Discord community
- ๐ง Email: support@capgo.app