⚠️ Setup Android Credentials First
Required: You must save your Android credentials before building release apps.
Construction and Soumettre Android apps to the Google Play Store using Capgo’s secure cloud infrastructure.
⚠️ Setup Android Credentials First
Required: You must save your Android credentials before building release apps.
Android builds run in secure Cloudflare sandboxes:
Before Construction for Android, you need:
npx cap open androidFor Libération builds, you need a signing keystore:
| Construction Type | Keystore Required | Purpose |
|---|---|---|
| Débogage | No | Test only, auto-generated |
| Libération | Yes | Play Store submission |
If you don’t have a keystore yet, Créer one:
keytool -genkey -v \ -keystore my-release-key.keystore \ -alias my-key-alias \ -keyalg RSA \ -keysize 2048 \ -validity 10000Answer the prompts:
When creating a keystore, you’ll need to remember:
KEYSTORE_STORE_PASSWORD): The password for the keystore file itselfKEYSTORE_KEY_ALIAS): The name/identifier for your signing key within the keystoreKEYSTORE_KEY_PASSWORD): The password for the specific key (can be the same as store password)Example workflow:
# List aliases in your keystore to verifykeytool -list -keystore my-release-key.keystore
# View detailed information about your keykeytool -list -v -keystore my-release-key.keystore -alias my-key-aliasFor Libération builds, set these credentials:
# Android Signing (Required for release)ANDROID_KEYSTORE_FILE="<base64-encoded-keystore>"KEYSTORE_KEY_ALIAS="my-key-alias"KEYSTORE_KEY_PASSWORD="<key-password>"KEYSTORE_STORE_PASSWORD="<store-password>"
# Play Store Publishing (Optional, for auto-submission)PLAY_CONFIG_JSON="<base64-encoded-service-account-json>"Keystore File:
base64 -i my-release-key.keystore | pbcopyPlay Store Service Account JSON:
base64 -i play-store-service-account.json | pbcopyThe base64 string is now in your clipboard.
To Activer automatic Play Store uploads, you need to Créer a Google Cloud service Compte with proper permissions.
Créer Service Compte in Google Cloud
Créer JSON Key
Grant Permissions in Play Console
Accept the Invitation
Perfect for Test without signing:
npx @capgo/cli@latest build com.example.app \ --platform android \ --build-mode debugThis creates a Débogage APK that can be installed on any Appareil for Test.
For Play Store submission:
npx @capgo/cli@latest build com.example.app \ --platform android \ --build-mode releaseRequires signing credentials to be configured as environment variables.
name: Build Android App
on: push: branches: [main]
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6
- name: Setup Node.js uses: actions/setup-node@v6 with: node-version: '24'
- name: Install dependencies run: npm ci
- name: Build web assets run: npm run build
- name: Sync Capacitor run: npx cap sync android
- name: Build Android app env: CAPGO_TOKEN: ${{ secrets.CAPGO_TOKEN }} ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE }} KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_ALIAS }} KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} PLAY_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG }} run: | npx @capgo/cli@latest build ${{ secrets.APP_ID }} \ --platform android \ --build-mode releaseSandbox Initialisation (~5 seconds)
Project Configuration (~20 seconds)
Gradle Construction (2-4 minutes)
Play Store Télécharger (30 seconds, if configured)
Cleanup (immediate)
Our Android Construction environment includes:
By default, Capgo builds Créer:
Typical Android Construction times:
| Construction Type | Average Time |
|---|---|
| Débogage | 2-3 minutes |
| Libération (no ProGuard) | 3-4 minutes |
| Libération (with ProGuard) | 4-6 minutes |
If your app has custom build variants (e.g., staging, production), use build-config:
npx @capgo/cli@latest build com.example.app \ --platform android \ --build-mode release \ --build-config '{"variant":"staging"}'This will build the stagingRelease variant.
For apps with flavor dimensions:
--build-config '{"flavor":"premium","variant":"production"}'This builds the premiumProductionRelease variant.
“Keystore password incorrect”
“Key alias not found”
keytool -list -keystore my-release-key.keystore“Gradle build failed”
./gradlew assembleReleasebuild.gradle“Play Store upload failed”
“Build timeout”
Watch for these key phases in the Construction Journaux:
→ Downloading dependencies...→ Running Gradle assembleRelease...→ Signing APK/AAB...→ Uploading to Play Store...✔ Build succeededIf a Construction fails, the specific Gradle Erreur will be shown in the Journaux.
Always ensure your Android Construction works locally:
cd android./gradlew assembleRelease# or./gradlew bundleReleaseCapgo reads version from your capacitor.config.json:
{ "appId": "com.example.app", "appName": "My App", "version": "1.0.0", "build": "1"}Increment the build number for each release.
For Libération builds, ensure ProGuard rules are properly configured:
-keep class com.getcapacitor.** { *; }-keep @com.getcapacitor.annotation.CapacitorPlugin public class * { @com.getcapacitor.annotation.PluginMethod public <methods>;}Keep an eye on APK/AAB size to ensure it’s optimized:
The CLI shows final size:→ APK size: 12.4 MBIf your Application is large (>50 MB), consider:
With PLAY_CONFIG_JSON configured, builds are automatically uploaded to Play Console’s internal Test track.
If you prefer manual submission: