If you ever need to create use a script to upload your apk to google play without using the console, that the way!!
- Go to the Google Play Developer Console
- Choose the Credential section
- From the “Create Credential” popup select “create service account key”
- Select “New Service Account”
- Enter “my App Publisher” in service account name
- Select “project owner” in the role popup
- Choose the JSON radio button
- Press Create
- Save the file (for example: myGoogle.json) in a secure place.
- Open the JSON file and search for the value of “Client_Email“:
it will be something like:
xxxxxyyyy@api-lotsofnumbers.iam.gserviceaccount.com
we will use in the very next step.
- Open the JSON file and search for the value of “Client_Email“:
- Now go to the Google Play Console
- Go to the Settings item and the select Users & Roles
- Click on “add new user”
- enter the email taken from the JSON
- set the user as admin and save
- Now we need the script for the upload
- launch a teminal with the following command:
pip install google-api-python-client
- Now we get the actual script:
wget https://gist.githubusercontent.com/mix3d/665f4ab329b4482297a2f425ebba402c/raw/0949385dd6c80d0701170746b1bd5fd479303412/basic_upload_apks_service_account.py
- rename the script in upload.py
- we need an apk to upload for authorising the API, let call it myApk.apk with package my.app
- execute the following command:
python upload.py -a myApk.apk -p my.app -t beta -s myGoogle.json
- the command will ask to go to a google URL to confirm the API, copy it to the browser and authorise the API.
- Done, your script is set
- launch a teminal with the following command:
last point, the -t parameter you can choose between the following parameters:
‘alpha‘, ‘beta‘, ‘production‘,’rollout‘