Automating Google Play publishing

If you ever need to create use a script to upload your apk to google play without using the console, that the way!!

  1. Go to the Google Play Developer Console
    1. Choose the Credential section
    2. From the “Create Credential” popup select “create service account key”
    3. Select “New Service Account”
      1. Enter “my App Publisher” in service account name
      2. Select “project owner” in the role popup
      3. Choose the JSON radio button
      4. Press Create
      5. Save the file (for example: myGoogle.json) in a secure place.
        1. Open the JSON file and search for the value of “Client_Email“:
          it will be something like:
          we will use in the very next step.
  2. Now go to the Google Play Console
    1. Go to the Settings item and the select Users & Roles
    2. Click on “add new user
      1. enter the email taken from the JSON
      2. set the user as admin and save
  3. Now we need the script for the upload
    1. launch a teminal with the following command:

      pip install google-api-python-client

    2. Now we get the actual script:


    3. rename the script in
    4. we need an apk to upload for authorising the API, let call it myApk.apk with package
    5. execute the following command:

      python -a myApk.apk -p -t beta -s myGoogle.json

    6. the command will ask to go to a google URL to confirm the API, copy it to the browser and authorise the API.
    7. Done, your script is set

last point, the -t parameter you can choose between the following parameters:
alpha‘, ‘beta‘, ‘production‘,’rollout