Generate JSON key for Google Play deployment

In order to allow our CI server to deploy applications on Google Play automatically, we have to generate the JSON key.

This whole process has three parts:

  1. Create a Service account
  2. Generate the key
  3. Grant access to our key

Thanks to this key, we can quickly deploy applications without manually uploading each and every version. We can also control what version we did upload on Google Play through our CI server.

black-google-smartphone-on-box
Photo by Deepanker Verma from Pexels

Create a Service account

Google Play screenshot with Settings red highlighted

3. On the left menu expand the Developer account and choose API access.

Google Play Console side menu with Developer account and API access highlighted

4. Click Create a service account.

API access page in Google Play Console with the Create service account button highlighted

5. On displayed dialog click Google Cloud Platform

Create new service account dialog with the Google Cloud Platform link highlighted

6. After redirecting to Google Cloud Platform, we create the Service account, using Create service account.

Service accounts list in Google Cloud Platform with the Create service account button highlighted

7. Enter Service account name, for example, google_play_publish_worker, Service account id generates automatically, and Service account description is optional, so we can keep it empty and hit Create.

Service account details form with the name google_play_publish_worker and the Create button

8. Choose role Service Account User in Service Accounts category and continue using Continue button.

Service account permissions with the Service Account User role selected and the Continue button

9. DON’T click Done!

Generate the key

1. Click Create key.

Keys section in Google Cloud: Add key menu with Create new key highlighted

2. Choose JSON and click Create.

Create key dialog with the JSON key type selected and the Create button

3. It starts downloading the .json file, which is our key we later upload on our CI server. So save it somewhere safe.

4. Now we can finish with Done

Grant access to our key

  1. Return to the previous tab where is Google play console and close the dialog using Done.

Create new service account dialog in Google Play Console with the Done button highlighted

2. The page automatically refreshes, and at the bottom, we should see our new Service account. Click Grant access to choose permissions.

New service account in Google Play Console with the Grant access button highlighted

3. Leave permissions as it is and click Invite user

Now we should be able, using this key uploaded on our CI server, to automatically deploy applications on Google Play.

Well done!

Do you need more detailed help? Book a consultation:

Let’s chat about it

Do you want more?

We share the world of software development on our Instagram. Join us :)

Studio SKOUMAL chart: mobile app revenue grew from 97.7 to 935.2 billion USD between 2014 and 2023

We also tend to look for Android dev (iOS as well), but there are also chances for a project manager or a tester. Send us an e-mail: skoumal@skoumal.net.