API to automatically upload apk to Google Play?
As of today there is a new official publishing API That allows you to upload to any channel (ie. alpha, beta...) or update title and description and more.
From the docs:
- Uploading new versions of an app Releasing apps, by assigning APKs to various Tracks (alpha, beta, staged rollout, or production)
- Creating and modifying Google Play Store listings, including
- localized text and graphics and multi-device screenshots
Look here for more info: https://developers.google.com/android-publisher/
Deploy to Google Play Store via API
Google releases a new API for automatic deploy to Alpha/Beta and Production channels!
take a look here
Api features:
- Uploading new versions of an app Releasing apps, by assigning APKs to
various Tracks (alpha, beta, staged rollout, or production) - Creating and modifying Google Play Store listings, including localized text
and graphics and multi-device screenshots
Updated:
Some java samples about how to use the API: samples
Updated (08-June-2015):
I found and I'm using a gradle plugin that use this API, its called gradle-play-publisher. It is very easy to use, you need only to get a Service account and download a p12 file with a certificate (PlayStore --> Settings --> API access >> "Create Service Account" >> choose p12 format and read instruction in plugin website!
Can't Upload APK to Google Play Developer via Publisher API
I think you have a misunderstanding of how NodeJS streams works.
In the sample code you have shown above you are trying to pipe the result of request.post
into fs.createReadStream
which doesn't make sense and that's reason for the error as you are not sending any apk file. Instead it should be done like the following. (I am not sure how androidpublisher api works, I assume your sample shows the correct usage.)
var url_create_listing = 'https://www.googleapis.com/androidpublisher/v2/applications/com.example.apps/edits?access_token='+tokens;
request.post( url_create_listing, function (error, response, body) {
var str_body = JSON.parse (body);
var listing_id = str_body.id;
var url_upload = 'https://www.googleapis.com/upload/androidpublisher/v2/applications/com.example.apps/edits/'+listing_id+'/apks?uploadType=media&access_token='+tokens;
// request module is capable of auto detecting the Content-Type header
// based on the file extension.
var options = {
url: url_upload
};
fs.createReadStream('example_file.apk')
.pipe(request.post(options, function optionalCallback(err, httpResponse, body){
if (err) {
return console.error('upload failed:', err);
}
console.log('Upload successful! Server responded with:', body);
}));
Is it possible to upload new apps to Google Play Store programatically?
Absolutely, it's possible.
Google Play provides the Publishing API for that exact purpose: https://developers.google.com/android-publisher
To make it simpler, some client libraries in Java and Python have been provided as well, with usage examples: https://developers.google.com/android-publisher/libraries
Related Topics
Live Character Count for Edittext
Loading All the Images from Gallery into the Application in Android
How to Programmatically Set Maxlength in Android Textview
Connectivity_Action Intent Received Twice When Wifi Connected
Android Task Affinity Explanation
How to Set Custom Typeface to Items in Navigationview
Android Sharedpreferences in Fragment
Debugging with Android Studio Stuck at "Waiting for Debugger" Forever
API to Automatically Upload APK to Google Play
Finding the Dominant Color of an Image in an Android @Drawable
Android Multiple Screen Sizes with Same Density
Custom Global Application Class Breaks with "Android.App.Application Cannot Be Cast To"
Cordova Platform Add Android Not Working While Listing Android Targets
Android Navigation Drawer on Top Actionbar
Nexus 5X Reverse Landscape Sensor Fix in a Android Camera Preview App