Managing Credentials
Manage your iOS and Android Construction credentials locally for convenient cloud builds.
Aperçu
Section titled “Aperçu”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.
Commandes
Section titled “Commandes”Enregistrer Credentials
Section titled “Enregistrer Credentials”Store your Construction 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”Retirer 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”Terminé Exemple
Section titled “Terminé Exemple”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 Enregistrer iOS credentials, the CLI:
- Reads the certificate and provisioning Profil 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”Terminé Exemple
Section titled “Terminé Exemple”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 Enregistrer Android credentials, the CLI:
- Reads the keystore and service Compte 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 Construction:
# 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 listExemple 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.Sécurité Best Practices
Section titled “Sécurité Best Practices”Local Storage Sécurité
Section titled “Local Storage Sécurité”-
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 Développement vs CI/CD
- Rotate credentials regularly
- Don’t share credentials between team Membres
CI/CD Utilisation
Section titled “CI/CD Utilisation”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 Utilisation
Credential Rotation
Section titled “Credential Rotation”Regularly rotate your credentials:
- iOS: Generate Nouveau certificates and Clés API yearly
- Android: Change keystore passwords annually
- After team changes: Rotate when team Membres leave
Mise à jour saved credentials:
# Re-run save command with new credentialsnpx @capgo/cli build credentials save --platform ios --certificate ./new-cert.p12 ...Dépannage
Section titled “Dépannage””No credentials found”
Section titled “”No credentials found””If the Construction says no credentials were found:
-
Vérifier if credentials are saved:
Terminal window npx @capgo/cli build credentials list -
Enregistrer 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”Vérifier 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-Enregistrer credentials
Section titled “Clear and re-Enregistrer 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 Migrer to saved credentials:
-
Extract your current environment variables
Terminal window echo $BUILD_CERTIFICATE_BASE64 # Verify they exist -
Decode base64 files Retour to original files (if needed)
Terminal window echo "$BUILD_CERTIFICATE_BASE64" | base64 -d > cert.p12echo "$BUILD_PROVISION_PROFILE_BASE64" | base64 -d > profile.mobileprovision -
Enregistrer 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 Construction
Terminal window npx @capgo/cli build com.example.app --platform ios -
Retirer 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 Enregistrer credentials for the first time.
Suivant Steps
Section titled “Suivant Steps”- Commencer - Créer your first Construction
- iOS Builds - iOS-specific Construction Configuration
- Android Builds - Android-specific Construction Configuration
- Dépannage - Problèmes courants and Solutions
Need Aide?
Section titled “Need Aide?”- 📚 Dépannage Guide
- 💬 Discord Communauté
- 📧 Email: Support@capgo.Application