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.jsonfile 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.packageA 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.pyand 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.