Skip to content

Managing Credentials

Manage your iOS and Android build credentials locally for convenient cloud builds.

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.

Store your build credentials locally for automatic use:

Terminal window
npx @capgo/cli build credentials save --platform <ios|android> [options]

View currently saved credentials (passwords are masked):

Terminal window
npx @capgo/cli build credentials list

Remove saved credentials from your local machine:

Terminal window
# Clear all credentials
npx @capgo/cli build credentials clear
# Clear only iOS credentials
npx @capgo/cli build credentials clear --platform ios
# Clear only Android credentials
npx @capgo/cli build credentials clear --platform android
Terminal window
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"
OptionDescriptionRequired
--certificate <path>Path to .p12 certificate fileYes (release)
--p12-password <password>Password for the .p12 certificateYes (release)
--provisioning-profile <path>Path to .mobileprovision fileYes (release)
--provisioning-profile-prod <path>Production provisioning profile (optional)No
--apple-key <path>Path to App Store Connect API .p8 keyYes (submission)
--apple-key-id <id>App Store Connect API Key IDYes (submission)
--apple-issuer-id <id>App Store Connect API Issuer ID (UUID)Yes (submission)
--apple-team-id <id>App Store Connect Team IDYes (submission)
--apple-id <email>Apple ID email (alternative auth)No
--apple-app-password <password>App-specific password (alternative auth)No

When you save iOS credentials, the CLI:

  1. Reads the certificate and provisioning profile files
  2. Converts them to base64 encoding
  3. Saves the credentials to the .capgo-credentials folder
  4. 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"
}
}
Terminal window
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.json
OptionDescriptionRequired
--keystore <path>Path to .keystore or .jks fileYes (release)
--keystore-alias <alias>Key alias in the keystoreYes (release)
--keystore-key-password <password>Password for the key aliasYes (release)
--keystore-store-password <password>Password for the keystoreYes (release)
--play-config <path>Path to Play Store service account JSONYes (submission)

When you save Android credentials, the CLI:

  1. Reads the keystore and service account JSON files
  2. Converts them to base64 encoding
  3. Saves the credentials to the .capgo-credentials folder
  4. 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": "..."
}
}
}

Once you’ve saved credentials, they’re automatically used when you build:

Terminal window
# Credentials automatically loaded from .capgo-credentials folder
npx @capgo/cli build com.example.app --platform ios

You can also override saved credentials using environment variables:

Terminal window
# Environment variables take precedence over saved credentials
BUILD_CERTIFICATE_BASE64="..." \
P12_PASSWORD="different-password" \
npx @capgo/cli build com.example.app --platform ios

Precedence order:

  1. Environment variables (highest priority)
  2. Saved credentials in .capgo-credentials folder
  3. No credentials (lowest priority)

List what credentials you have saved:

Terminal window
npx @capgo/cli build credentials list

Example 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).
  1. File Permissions

    Terminal window
    # Ensure credentials folder is not readable by others
    chmod 700 .capgo-credentials
    chmod 600 .capgo-credentials/*
  2. Never Commit Credentials

    Terminal window
    # Add to .gitignore
    echo ".capgo-credentials/" >> .gitignore
  3. Separate Credentials

    • Use different credentials for local development vs CI/CD
    • Rotate credentials regularly
    • Don’t share credentials between team members

For CI/CD environments, prefer environment variables over saved credentials:

# GitHub Actions
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_CERTIFICATE }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
# ... other secrets

This 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

Regularly rotate your credentials:

  1. iOS: Generate new certificates and API keys yearly
  2. Android: Change keystore passwords annually
  3. After team changes: Rotate when team members leave

Update saved credentials:

Terminal window
# Re-run save command with new credentials
npx @capgo/cli build credentials save --platform ios --certificate ./new-cert.p12 ...

If the build says no credentials were found:

  1. Check if credentials are saved:

    Terminal window
    npx @capgo/cli build credentials list
  2. Save credentials if missing:

    Terminal window
    npx @capgo/cli build credentials save --platform ios ...
  3. 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:

Terminal window
chmod 700 .capgo-credentials
chmod 600 .capgo-credentials/*

Check that the correct platform is specified:

Terminal window
# Make sure --platform matches saved credentials
npx @capgo/cli build com.example.app --platform ios # Uses ios credentials
npx @capgo/cli build com.example.app --platform android # Uses android credentials

If credentials seem corrupted:

Terminal window
# Clear all credentials
npx @capgo/cli build credentials clear
# Save again
npx @capgo/cli build credentials save --platform ios ...

If you’re currently using environment variables, you can migrate to saved credentials:

  1. Extract your current environment variables

    Terminal window
    echo $BUILD_CERTIFICATE_BASE64 # Verify they exist
  2. Decode base64 files back to original files (if needed)

    Terminal window
    echo "$BUILD_CERTIFICATE_BASE64" | base64 -d > cert.p12
    echo "$BUILD_PROVISION_PROFILE_BASE64" | base64 -d > profile.mobileprovision
  3. 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"
  4. Test the build

    Terminal window
    npx @capgo/cli build com.example.app --platform ios
  5. Remove environment variables (optional)

    Terminal window
    unset BUILD_CERTIFICATE_BASE64 BUILD_PROVISION_PROFILE_BASE64

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.