A collection of command-line samples for the Play Developer Publishing API.
- Download Google APIs Client Library for Python (google-api-python-client): https://code.google.com/p/google-api-python-client/
or use pip:
$ pip install google-api-python-client
- Make sure you can import the client library:
$ python
>>> import apiclient
>>>
-
Edit the
client_secrets.json
file and add the client ID and client secret. -
Execute any of the scripts to begin the auth flow:
$ python basic_list_apks.py com.myapp.package
A browser window will open and ask you to login. Make sure the account has enough permissions in the Google Play Developer console.
- Accept the permissions dialog. The browser should display
The authentication flow has completed.
Close the window and go back to the shell.
-
The script will output a list of apks.
-
The tokens will be stored in
androidpublisher.dat
. Remove this file to restart the auth flow.
-
Edit
basic_list_apks_service_account.py
and add the service account Email address. -
Copy the service account key file, generated in the Google APIs Console into the same directory and rename it to
key.p12
. -
Execute the script:
$ python basic_list_apks_service_account.py com.myapp.package
- The script will output a list of apks.