Introduction
This module will publish/update an Android apk programmatically (dynamically), from an Android project, faster and without Android Studio, to the Google Play Store.
Installation
Install via pip:
pip install os_android_apk_google_play_publisher
Prerequisites
Google Play Console API isn't open automatically. You should enable it from your Google Play Console account.
To do so, log in to your Google Play Console account and:
- At the left pane, navigate to Settings -> API Access -> Agree to link your project
- At the API access page, under "OAuth clients" click on "View in Google Cloud Console"
- Under OAuth 2.0 Client IDs click on your client id (usually "Google Play Android Developer")
- At the top, click on "DOWNLOAD JSON" and save the file in a secure location on your computer
- IMPORTANT: change the JSON file name to be client_secrets.json so Google's algorithm could read it
Usage
After you've downloaded the client_secrets.json
file, you can run the program:
import os_android_apk_google_play_publisher.apk_publisher as ap
ap.publish_binary('com.my.packagename',
'/path/to/my.apk',
'/path/to/client_secrets.json',
'0.5', # publish percent
'3') # version code
If you want to update an already uploaded rollout, set None in the apk path argument in the publish_binary function.
Links
If you all about automation, why use Android Studio?:
os_android_apk_builder-py -> Create an Android apk programmatically (dynamically), from an Android project, faster and without Android Studio.
Licence
MIT