Authentication
gplay authenticates to the Google Play Developer API with a service account. You can let gplay set everything up for you, or create the service account by hand.
One-command setup (recommended)
Section titled “One-command setup (recommended)”gplay setup --autoThis drives the whole flow via gcloud:
- Installs the
gcloudCLI if it’s missing (Homebrew on macOS, curl on Linux) - Logs you into Google Cloud
- Enables the Android Publisher API
- Creates a service account and downloads a JSON key
- Stores the profile in
~/.gplay/config.json - Opens Play Console for the one manual step: granting the account access
Useful variants:
gplay setup --auto --project my-gcp-project # explicit GCP projectgplay setup --auto --dry-run # preview the gcloud commandsgplay setup --auto --no-browser # CI / agent friendlygplay setup # print manual instructionsAlready have a service account key?
Section titled “Already have a service account key?”gplay auth login --service-account /path/to/service-account.jsonManual setup
Section titled “Manual setup”Create the service account by hand (full control)
1. Create a Google Cloud project at console.cloud.google.com.
2. Enable the API — APIs & Services → Library → search “Google Play Android Developer API” → Enable.
3. Create a service account — IAM & Admin → Service Accounts → Create. Then open it → Keys → Add Key → JSON, and save the file securely.
4. Grant access in Play Console — play.google.com/console → Users and permissions → Invite new users → enter the service account email ([email protected]) → set permissions → Invite.
5. Log in with gplay:
gplay auth login --service-account /path/to/service-account.jsonValidate your setup
Section titled “Validate your setup”gplay auth doctorauth doctor checks the credential file, API access, and app permissions, and explains exactly what’s wrong when something fails. It can even fix common issues:
gplay auth doctor --fix --confirmMultiple accounts (profiles)
Section titled “Multiple accounts (profiles)”gplay auth login --service-account key.json --profile workgplay auth switch --profile workgplay auth statusOr set per-invocation with the GPLAY_PROFILE environment variable.
Environment variables
Section titled “Environment variables”| Variable | Purpose |
|---|---|
GPLAY_SERVICE_ACCOUNT |
Path to service account JSON |
GPLAY_PACKAGE |
Default package name |
GPLAY_PROFILE |
Active profile name |
Next step
Section titled “Next step”Ship something: Quickstart →