Blog

Android, Tech

Push automatically an application on the Play Store

By Florent Champigny, Android Developer at Backelite

 

 

Prequel : Initial Play Store upload

The first APK or App Bundle needs to be uploaded via the Google Play Console because registering the app with the Play Store cannot be done using the Play Developer API.

For all subsequent uploads and changes this plugin can be used.

 

Create a Google Play Service Account

First thing, you have to create a service account with access to the Play Developer API.

You’ll find a guide to setting up the service account here.

 

     1. Navigate to play store publish

https://play.google.com/apps/publish/

Then click on Settings / API access

 

     2. Click on “Create Service Account”

This will redirect you to the service account dashboard

 

     3. Create an Oauth Client ID

 

     4. Select Service account

And check P12 key

 

Finally, download the and save preciously you P12 file 🔑

Once that’s done, you’ll need to grant the following permissions to your service account for this plugin to work (go to Settings / Developer account / API access / Service Accounts):

 

 

Setup your application

 

 

I will use the plugin “gradle-play-publisher” to configure my project, available on github :

https://github.com/Triple-T/gradle-play-publisher

 

Add the plugin “gradle-play-publisher” to your project’s dependencies:

Then apply the plugin on your app’s module

Then apply the plugin on your app’s module

 

Just paste here the service account email create on the play store console, and the path to your p12 file

This will create jobs depending on my project name and flavors, for example on the application named “Backelite”

 

Just run “./gradlew publishApkBackelitePlayStoreRelease” to publish a new apk on the play store

Please note this command can be a part of a jenkin’s job!

 

 

Update what’s new and description

Last cool thing 😎, you can set the “What’s new” message, and change all play store fields directly from your Android Studio project.