How to upload an Android app to the app store via command line

android, automation, command-line, google-play

Solution

These days you can do this fairly easily with Gradle Play Publisher:

plugins {
    id 'com.android.application'
    id 'com.github.triplet.play' version 'x.x.x'
}

android {
    ...
}

play {
    serviceAccountCredentials = file("your-credentials.json")
}

Then it's as simple as running `./gradlew publishApk`.

Problem

I found this question for `iOS` and basically worry about the same thing for `Android`. As part of the countinues integration process of my `Android` application, I want to create a process that will automatically upload the app (`.apk`) file to the `Google PlayStore`. I found this website explaining how to create an `.apk` automated. So I wonder if there is a way to upload the `.apk` file to the `PlayStore` via command line?

Original source

Related problems