-
Notifications
You must be signed in to change notification settings - Fork 0
Automating Publishing to the Play Store
The Developer Console for Google Play provides API support for you to be able to push to the store automatically. This ability allows you to trigger builds on your continuous integration server (i.e. Jenkins) and have them uploaded the Play store for alpha or beta testing, as well as pushing to production directly.
-
Navigate to
Settings->API Access: -
There should be a
Service Accountssection where you need to click theCreate Service Account button. You will be asked to click on the first step to take you to the Google Developers Console. -
Click on the
Create New Client IDbutton. -
Click to create new
Service Account. Make sure to also request the.p12 Key Fileinstead of JSON: -
You will be prompted to download the .p12 file. Save it somewhere.
-
Note the service account email associated with this new account. You should see it appear in the Google Developer Console:
If you want to be able to automate deploys through Gradle, you can install a plugin such as the Gradle Play Publisher.
-
Add the following to the top of your
app/build.gradlefile:buildscript { repositories { mavenCentral() } dependencies { // ... classpath 'com.github.triplet.gradle:play-publisher:1.0.2' } } apply plugin: 'play'
-
Configure the plugin with the Google Service Account and p12 file saved in steps #5 and #6.
play { track = 'alpha' serviceAccountEmail = '[email protected]' pk12File = file('Google Play Android Developer-12345.p12') }
-
The plugin creates the following tasks for you:
| Command | Description | |:---------------------------:|--------------------------------------------------------------------- | |publishApkRelease | Uploads the APK and the summary of recent changes. | |publishListingRelease | Uploads the descriptions and images for the Play Store listing. | |publishRelease | Uploads everything. | |bootstrapReleasePlayResources| Fetch data from the Play Store & bootstrap the required files/folders|
You can now type the following gradle commands such as the following:
./gradlew publishApkReleaseCreated by CodePath with much help from the community. Contributed content licensed under cc-wiki with attribution required. You are free to remix and reuse, as long as you attribute and use a similar license.
Finding these guides helpful?
We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.
Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.
Interested in ramping up on Android quickly?
(US Only) If you are an existing engineer with 2+ years of professional experience in software development and are serious about ramping up on Android quickly, be sure to apply for our free evening 8-week Android bootcamp.
We've trained over a thousand engineers from top companies including Apple, Twitter, Airbnb, Uber, and many others leveraging this program. The course is taught by Android experts from the industry and is specifically designed for existing engineers.
Not in the United States? Please fill out our application of interest form and we’ll notify you as classes become available in your area powered by local organizers.