Skip to main content
Back to Documentation

Google Play Store Setup

Learn how to configure Google Play Store API access to submit your AAB builds directly from Mobiforge.

Overview

To submit AAB builds to Google Play Store, you need to configure a Service Account with the Google Play Developer API. This allows Mobiforge to upload your builds programmatically.

Important

Only AAB files can be submitted to Google Play Store. APK files cannot be uploaded. Make sure to build your app as AAB format.

Prerequisites

  • Google Play Developer Account

    You must have a registered Google Play Developer account ($25 one-time fee)

  • App Created in Play Console

    Your app must exist in Google Play Console (can be a draft, doesn't need to be published)

  • Play App Signing Enabled

    Play App Signing must be enabled for your app (required for AAB uploads)

  • Google Cloud Project

    A Google Cloud project with billing enabled (free tier is sufficient)

Creating Your App in Play Console

Before you can submit builds, you need to create an app in Google Play Console. The package name is automatically determined from the first AAB/APK you upload, and then becomes fixed.

Step 1: Create New App

  1. Go to Google Play Console
  2. Click "Create app" button (top right)
  3. Fill in the app name (you can change this later)
  4. Select "Yes" for "Is this app free or paid?" (you can change this later)
  5. Accept the terms and click "Create app"

Step 2: Bootstrap Upload (Required First Time)

Important: You must do a manual bootstrap upload the first time. This "registers" your package name in Play Console and allows API uploads to work reliably.

⚠️ Required: The first upload must be done manually in Play Console. After that, you can use the API to submit builds automatically.

  1. Set your package name in Mobiforge first (Project Settings → Package Name)
  2. Build your first AAB in Mobiforge with that package name
  3. Go to Play Console → Testing → Internal testing → Create release
  4. Upload the AAB manually (drag & drop or browse)
  5. Submit the release (internal testing is enough)
  6. After this bootstrap upload, the package is "recognized" and API uploads will work

💡 Why? This bootstrap upload ensures Play Console recognizes your package name and service account. Without it, API uploads may fail with 404 errors or permission issues.

Step 3: Package Name is Now Fixed

After the bootstrap upload, the package name is permanently set and cannot be changed.

  • Play Console automatically reads the package name from the AAB's AndroidManifest.xml
  • Once set from the first upload, the package name cannot be changed - it's permanent
  • All future uploads must use the same package name

⚠️ Warning: If you make a mistake with the package name, you'll need to create a new app in Play Console.

Step 4: Complete App Setup (Optional)

You can skip most of the initial setup. The app just needs to exist (even as a draft) for API access to work.

  • You can skip the store listing, graphics, and other details for now
  • The app doesn't need to be published - it just needs to exist
  • You can come back later to complete the store listing

💡 How It Works

The package name comes from the applicationId in your AAB's AndroidManifest.xml. This is set in Mobiforge when you configure your package name. When you upload your first AAB, Play Console reads this value and locks it in.

Best practice: Set your package name in Mobiforge first (Project Settings → Package Name), then build and upload your first AAB. The format is: com.yourcompany.appname

Step-by-Step API Setup

Once your app is created in Play Console with the correct package name, follow these steps to set up API access.

Getting the service account key

You can create the service account and download its JSON key in two ways: automated (Google Cloud Shell) or manual (Google Cloud Console).

AutomatedUsing Google Cloud Shell

Fastest option if you use Cloud Shell. Copy and paste the script, then download the generated key file.

  1. In Google Cloud Console, select your project in the top bar (or create one first).
  2. Open Cloud Shell (terminal icon in the top bar).
  3. Copy the entire script below, paste it into the Cloud Shell terminal, and press Enter.
  4. When prompted or when the script finishes, use Download file in Cloud Shell to save mobiforge-play-key.json (the script also runs cloudshell download mobiforge-play-key.json to trigger the download).
  5. Then complete Link Google Cloud Project to Play Console (Step 5), Add Service Account to Users and Permissions (Step 6), and Configure in Mobiforge (Step 8) below.
PROJECT_ID=$(gcloud config get-value project)

if [ -z "$PROJECT_ID" ]; then
  echo "❌ No project selected. Please select a project in the top bar first."
  exit 1
fi

echo "Using project: $PROJECT_ID"

# Enable Play Developer API
gcloud services enable androidpublisher.googleapis.com

# Create service account (ignore if already exists)
gcloud iam service-accounts create mobiforge-play-uploader \
  --display-name="Mobiforge Play Uploader" 2>/dev/null || true

# Create JSON key file
gcloud iam service-accounts keys create mobiforge-play-key.json \
  --iam-account=mobiforge-play-uploader@$PROJECT_ID.iam.gserviceaccount.com

echo ""
echo "✅ Service account key created."
echo ""
echo "📄 JSON content:"
echo "-----------------------------------"
cat mobiforge-play-key.json
echo "-----------------------------------"
echo ""
echo "⬇️ Downloading file..."

# Trigger download in Cloud Shell
cloudshell download mobiforge-play-key.json

The script enables the Play Developer API, creates the mobiforge-play-uploader service account (if it doesn’t exist), creates a new JSON key, prints it, and triggers the Cloud Shell download. Save the file and upload it in Mobiforge after adding the service account in Play Console (Step 6).

ManualUsing Google Cloud Console

Follow Steps 1–4 below: create or select a project, enable the Google Play Android Developer API, create a service account, then create and download a JSON key. Then continue with Steps 5–8 (Play Console and Mobiforge).

1

Create or Select Google Cloud Project

1. Go to Google Cloud Console

2. Create a new project or select an existing one

3. Make sure billing is enabled (free tier is sufficient)

2

Enable Google Play Android Developer API

1. In Google Cloud Console, go to APIs & Services → Library

2. Search for "Google Play Android Developer API"

3. Click on it and press "Enable"

Note: This API allows programmatic access to your Play Console to upload builds and manage releases.

3

Create Service Account

1. Go to IAM & Admin → Service Accounts

2. Click "Create Service Account"

3. Enter a name (e.g., "Play Store Uploader") and description

4. Click "Create and Continue"

5. Skip the optional role assignment (we'll set permissions in Play Console)

6. Click "Done"

4

Create and Download Service Account Key

1. Click on the service account you just created

2. Go to the "Keys" tab

3. Click "Add Key" → "Create new key"

4. Select "JSON" as the key type

5. Click "Create" - the JSON file will download automatically

Service Account JSON Format

The JSON file should contain: type: "service_account", project_id, private_key_id, private_key, and client_email

5

Link Google Cloud Project to Play Console

1. Go to Google Play Console

2. Select your app (or create a new one if needed)

3. Go to Test and release → App integrity

4. Under "Google Cloud project", click "Link project"

5. Select the Google Cloud project you created in Step 1

6. Click "Link" and wait for the link to complete

6

Add Service Account to Users and Permissions

1. In Play Console, go to Users and permissions (left sidebar)

2. Click "Invite new users" or "Add users"

3. Enter the service account email address

💡 Finding the email: Open your service account JSON file and look for the "client_email" field. It looks like: service-account@project-id.iam.gserviceaccount.com

4. Under "App permissions", select your app

5. Assign the "Release Manager" role:

Required Permission

Release Manager - This allows the service account to upload AAB files and manage releases on all tracks (internal, alpha, beta, production)

6. Click "Send invitation" or "Add"

7. The service account should now appear in your users list with "Release Manager" permission

7

Enable Play App Signing (Required for AAB)

1. In Play Console, go to Release → Setup → App signing

2. If not already enabled, follow the prompts to enable Play App Signing

3. Google will generate an app signing key (or you can upload your own)

4. Register your upload key (the key you use to sign AABs before uploading)

Important: Play App Signing is mandatory for AAB uploads. Without it, Google Play will reject your AAB file.

8

Configure in Mobiforge

1. In Mobiforge, go to your project settings

2. Set your Android package name (must match the one in Play Console)

3. Open the Play Store settings modal

4. Upload the service account JSON file you downloaded in Step 4

5. Click "Save & Verify" - Mobiforge will test the connection

6. Once verified, you can submit AAB builds directly to Google Play!

Service Account JSON Format

The service account JSON file should have the following structure:

{
  "type": "service_account",
  "project_id": "your-project-id",
  "private_key_id": "key-id",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": "service-account@project.iam.gserviceaccount.com",
  "client_id": "123456789",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  ...
}

Required fields:

  • type - Must be "service_account"
  • project_id - Your Google Cloud project ID
  • private_key_id - Unique identifier for the key
  • private_key - The private key in PEM format
  • client_email - Service account email address

Required Permissions

Release Manager

This is the minimum permission required. It allows:

  • Upload AAB files to all release tracks
  • Create and manage releases
  • Update release notes
  • Roll out releases to production

Note: You can also grant "Admin" permission, but "Release Manager" is sufficient and follows the principle of least privilege.

Troubleshooting

"Permission denied" error

Make sure the service account has Release Manager permission in Play Console → Settings → API access. The permission change can take a few minutes to propagate.

"App not found" error

Verify that the package name in Mobiforge matches exactly the package name registered in Google Play Console. Package names are case-sensitive.

"Play App Signing not enabled" error

Go to Play Console → Release → Setup → App signing and enable Play App Signing. This is required for all AAB uploads.

"Invalid service account JSON" error

Make sure you downloaded the JSON key file (not a P12 key). The file should start with { and contain "type": "service_account".

Next Steps

Once your service account is configured, you can:

  • Build your app as AAB format (not APK)
  • Submit AAB builds directly to Google Play Store from the build history
  • Choose release tracks: internal, alpha, beta, or production
  • Add release notes when submitting