gpc-multi-app
gpc-multi-app
Managing multiple Google Play apps with GPC using profiles, scripting, and automation patterns.
When to use
- Managing multiple Android apps (portfolio, white-label, variants)
- Running the same GPC command across several apps
- Setting up per-app configurations and credentials
- Monorepo with multiple Android modules
- Different service accounts for different apps
Inputs required
- Authenticated GPC —
gpc auth statusmust show valid credentials - Package names — for all apps being managed
- Service account keys — may differ per app or developer account
Procedure
0. Understand app resolution
GPC resolves the target app in this order:
--appCLI flag (highest priority)GPC_APPenvironment variable.gpcrc.jsonin project directory- User config at
~/.config/gpc/config.json - Active profile override
1. Quick health check across all apps
Use gpc status --all-apps to check health across all configured apps at once:
gpc status --all-apps
This reports the status of every app defined in your profiles or config, without needing to switch profiles or pass --app for each one.
2. Per-app configuration with profiles
Set up named profiles for each app:
# Configure profiles in ~/.config/gpc/config.json
{
"app": "com.example.main",
"profiles": {
"main": {
"app": "com.example.main",
"auth": { "serviceAccount": "/keys/main-sa.json" }
},
"lite": {
"app": "com.example.lite",
"auth": { "serviceAccount": "/keys/main-sa.json" }
},
"enterprise": {
"app": "com.example.enterprise",
"auth": { "serviceAccount": "/keys/enterprise-sa.json" }
}
}
}
Use profiles per command:
gpc releases list --profile main
gpc releases list --profile lite
gpc releases list --profile enterprise
Or set via environment:
export GPC_PROFILE=enterprise
gpc releases list # uses enterprise profile
Read: references/profile-patterns.md for advanced profile configurations.
3. Project-level .gpcrc.json
For monorepos, place .gpcrc.json in each app's directory:
monorepo/
├── apps/
│ ├── main/
│ │ ├── .gpcrc.json # { "app": "com.example.main" }
│ │ └── build.gradle
│ ├── lite/
│ │ ├── .gpcrc.json # { "app": "com.example.lite" }
│ │ └── build.gradle
│ └── enterprise/
│ ├── .gpcrc.json # { "app": "com.example.enterprise" }
│ └── build.gradle
└── .gpcrc.json # shared defaults
GPC walks up from the current directory to find .gpcrc.json, so running commands from each app's directory automatically uses the right package name.
4. Batch operations with shell scripts
Run the same command across all apps:
#!/bin/bash
# deploy-all.sh — upload to internal track for all apps
APPS=(
"com.example.main"
"com.example.lite"
"com.example.enterprise"
)
for app in "${APPS[@]}"; do
echo "Uploading $app..."
gpc releases upload "build/$app/app-release.aab" --track internal --app "$app"
done
5. Batch vitals check
#!/bin/bash
# check-vitals.sh — check crash rate across all apps
APPS=("com.example.main" "com.example.lite" "com.example.enterprise")
THRESHOLD=2.0
FAILED=0
for app in "${APPS[@]}"; do
echo "Checking $app..."
if ! gpc vitals crashes --threshold "$THRESHOLD" --app "$app"; then
echo "FAIL: $app crash rate exceeds ${THRESHOLD}%"
FAILED=1
fi
done
exit $FAILED
6. CI/CD for multiple apps
Read: references/ci-multi-app.md for CI platform-specific multi-app workflows.
GitHub Actions matrix strategy
name: Deploy All Apps
on:
push:
tags: ['v*']
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
app:
- { package: "com.example.main", aab: "main/app-release.aab" }
- { package: "com.example.lite", aab: "lite/app-release.aab" }
- { package: "com.example.enterprise", aab: "enterprise/app-release.aab" }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Upload to internal
env:
GPC_SERVICE_ACCOUNT: ${{ secrets.PLAY_SA_KEY }}
GPC_APP: ${{ matrix.app.package }}
run: npx @gpc-cli/cli releases upload ${{ matrix.app.aab }} --track internal
7. Different service accounts per app
When apps belong to different developer accounts:
# Use different env vars per command
GPC_SERVICE_ACCOUNT=$(cat keys/main.json) gpc releases list --app com.example.main
GPC_SERVICE_ACCOUNT=$(cat keys/client.json) gpc releases list --app com.client.app
Or use profiles (recommended):
{
"profiles": {
"main": {
"app": "com.example.main",
"auth": { "serviceAccount": "/keys/main-sa.json" }
},
"client": {
"app": "com.client.app",
"auth": { "serviceAccount": "/keys/client-sa.json" }
}
}
}
8. Bulk metadata sync
Sync listings for all apps from a shared metadata structure:
# metadata/
# ├── com.example.main/
# │ └── en-US/
# ├── com.example.lite/
# │ └── en-US/
for dir in metadata/*/; do
app=$(basename "$dir")
echo "Syncing $app..."
gpc listings push --dir "$dir" --app "$app" --dry-run
done
Verification
gpc config list --profile <name>shows correct app and auth per profile- Commands with
--appor--profiletarget the right app - Batch scripts exit 0 when all apps succeed
- CI matrix runs deploy independently per app
.gpcrc.jsonin subdirectories correctly overrides the default app
Failure modes / debugging
| Symptom | Likely Cause | Fix |
|---|---|---|
| Wrong app targeted | --app not set, picking up default |
Always pass --app or use profiles explicitly |
API_FORBIDDEN on one app |
Service account lacks access for that app | Check permissions per app in Play Console |
| Batch script fails silently | Missing error handling in loop | Use set -e or check $? after each command |
| Profile not found | Typo in profile name | Check gpc config list for available profiles |
| CI matrix job fails one app | Independent failure | Matrix jobs run independently — check logs per app |
.gpcrc.json not picked up |
Running from wrong directory | GPC walks up from cwd; ensure you're in the right dir |
Related skills
- gpc-setup — initial auth and profiles configuration
- gpc-ci-integration — CI pipeline setup for single apps
- gpc-sdk-usage — programmatic multi-app management with the TypeScript SDK
- gpc-user-management — managing per-app permissions for team members
More from yasserstudio/gpc-skills
gpc-sdk-usage
Use when building applications that programmatically interact with the Google Play Developer API using GPC's TypeScript SDK packages. Make sure to use this skill whenever the user mentions @gpc-cli/api, @gpc-cli/auth, PlayApiClient, createApiClient, resolveAuth, Google Play API client, TypeScript SDK, programmatic access, API client, HTTP client, rate limiter, pagination, edit lifecycle in code, Node.js Google Play, server-side Play Store, backend integration — even if they don't explicitly say 'SDK.' Also trigger when someone wants to build a backend service, custom dashboard, automation script, or any TypeScript/JavaScript application that interacts with Google Play programmatically rather than through the CLI. For CLI usage, see other gpc-* skills. For building plugins, see gpc-plugin-development.
12gpc-release-flow
Use when uploading, releasing, promoting, or managing rollouts on Google Play. Make sure to use this skill whenever the user mentions gpc releases, upload AAB, upload APK, staged rollout, promote to production, halt rollout, gpc publish, release notes, track management, internal testing, beta release, production rollout, version code, rollout percentage, gpc bundles, bundle list, bundle wait, wait for bundle processing, in-app update priority, retain version codes, versioned changelogs, or wants to ship an Android app to any Play Store track. Also trigger when someone asks about the Google Play edit lifecycle, release validation, or how to do a phased rollout — even if they don't mention GPC by name. For metadata and listings, see gpc-metadata-sync. For CI/CD integration, see gpc-ci-integration.
12gpc-security
Use when dealing with GPC credential security, secret management, audit logging, or access control. Make sure to use this skill whenever the user mentions credentials, service account key, secret rotation, key rotation, credential storage, audit log, audit trail, security best practices, .gpcrc.json security, secrets in CI, GPC_SERVICE_ACCOUNT safety, keychain, token cache, credential leak, key compromise, secure deployment — even if they don't explicitly say 'security.' Also trigger when someone asks about where GPC stores credentials, how to rotate service account keys, how to audit who did what with GPC, how to securely pass credentials in CI/CD, or how to handle a compromised service account key. For auth setup, see gpc-setup. For CI configuration, see gpc-ci-integration.
12gpc-setup
Use when setting up GPC (Google Play Console CLI): authentication with service accounts, OAuth, or Application Default Credentials; configuration files (.gpcrc.json, env vars, XDG paths); auth profiles; running gpc doctor; troubleshooting auth errors. Make sure to use this skill whenever the user mentions gpc auth, service account setup, gpc config, gpc doctor, GPC_SERVICE_ACCOUNT, gpc auth login, Google Play API credentials, Play Console authentication, gpc setup, gpc setup wizard, one-command onboarding, or wants to install/configure GPC — even if they don't explicitly say 'setup.' Also trigger when someone is troubleshooting auth failures, token expiration, keychain issues, or proxy/network configuration for GPC.
11gpc-monetization
Use when managing in-app purchases, subscriptions, pricing, or Real-Time Developer Notifications in Google Play. Make sure to use this skill whenever the user mentions gpc subscriptions, gpc iap, gpc purchases, gpc pricing, gpc rtdn, in-app products, base plans, subscription offers, one-time products, consumable products, purchase verification, purchase acknowledgement, purchase token, subscription cancellation, subscription deferral, voided purchases, refunds, regional pricing, currency conversion, price migration, SKU management, monetization, revenue, billing, subscription analytics, churn, trial conversion, subscriber count, RTDN, Real-Time Developer Notifications, Pub/Sub notifications, subscription events, purchase events — even if they don't explicitly say 'monetization.' Also trigger when someone wants to create or update subscriptions, manage base plan lifecycle (activate/deactivate), set up introductory offers, verify server-side purchases, handle refunds, convert prices across regions, sync IAP products from files, migrate subscribers to new prices, view subscription analytics, decode Pub/Sub notification payloads, or check RTDN topic configuration. For release management, see gpc-release-flow. For CI automation, see gpc-ci-integration.
11gpc-metadata-sync
Use when managing Google Play store listings, metadata, screenshots, or images. Make sure to use this skill whenever the user mentions gpc listings, store listing, metadata sync, screenshots, Fastlane metadata, localization, app description, pull listings, push listings, feature graphic, Play Store images, app title, short description, full description, changelogs, image sync, image dedup, listings images sync, or wants to update any text or visual content on their Play Store page. Also trigger when someone asks about migrating from Fastlane supply, syncing metadata to/from local files, managing multi-language listings, or bulk-updating store content — even if they don't mention GPC explicitly. For releases and uploads, see gpc-release-flow.
11