Skip to content

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.

Terminal window
gplay setup --auto

This drives the whole flow via gcloud:

  1. Installs the gcloud CLI if it’s missing (Homebrew on macOS, curl on Linux)
  2. Logs you into Google Cloud
  3. Enables the Android Publisher API
  4. Creates a service account and downloads a JSON key
  5. Stores the profile in ~/.gplay/config.json
  6. Opens Play Console for the one manual step: granting the account access

Useful variants:

Terminal window
gplay setup --auto --project my-gcp-project # explicit GCP project
gplay setup --auto --dry-run # preview the gcloud commands
gplay setup --auto --no-browser # CI / agent friendly
gplay setup # print manual instructions
Terminal window
gplay auth login --service-account /path/to/service-account.json
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 Consoleplay.google.com/console → Users and permissions → Invite new users → enter the service account email (name@project.iam.gserviceaccount.com) → set permissions → Invite.

5. Log in with gplay:

Terminal window
gplay auth login --service-account /path/to/service-account.json
Terminal window
gplay auth doctor

auth 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:

Terminal window
gplay auth doctor --fix --confirm
Terminal window
gplay auth login --service-account key.json --profile work
gplay auth switch --profile work
gplay auth status

Or set per-invocation with the GPLAY_PROFILE environment variable.

Variable Purpose
GPLAY_SERVICE_ACCOUNT Path to service account JSON
GPLAY_PACKAGE Default package name
GPLAY_PROFILE Active profile name

Ship something: Quickstart →