Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload an APK from Jenkins/Hudson to Play Store?

Tags:

I implemented a continuous integration pipeline using Jenkins, but as final step I want Jenkins to deploy/upload the signed APK file to Google Play Store and AndroidPit. I looked for Jenkins/Hudson plugins but only found two: one for Appaloosa and one for Zubhium.

I have a working developer account both on Google Play and on AndroidPit and can manually upload the APK that Jenkins produces. But my question is: Does anybody know a way to teach Jenkins (e.g. via a shell script?) to upload the APK to the mentioned app stores?

like image 743
mdt Avatar asked Jan 24 '13 18:01

mdt


2 Answers

There is a Google Play Android Publisher plugin for Jenkins which uses the Google Play Publishing API, announced at Google I/O 2014.

Google has also released Java and Python libraries to help make use of the API.

For more info on the API, see also:
http://android-developers.blogspot.com/2014/07/grow-with-google-play-scaled-publishing.html

like image 115
twaddington Avatar answered Oct 15 '22 09:10

twaddington


I can talk only for Google's Play Store. There is a way, but be warned, it isn't beautiful, you have to code your solution. I am right now writing a Bachelor Thesis to solve this problem - "Continuous Delivery for Android Applications". My solution is mine, this means I don't raise a claim to have the perfect solution, but I can say it is quite working prototype.

I found out the following:

  • The first Solution is none. Google offers an Play Store API, but it lacks to upload stuff. Seems that they were already thinking about to make such an API, but it only offers In-App billing control

  • The 2nd solution is to use Apache HttpComponents Library, which lets you implement your own Client for the Google Play Developer Console, but HttpClient lacks a JavaScript Interpreter... Several ways to implement or add one. But of course, not the easiest way.

  • The 3rd Solution I am working on, is to use Selenium Web Browser Automation Framework. So basically I create PageObjects from those Play Store Pages and dialogues. After that you can create some Factory to maintain "pathes" of controlling these PageObjects.

Using them you have two options as far as I can see, for instance the WebDriver Objects which uses an "invisible" browser process like FF or Chrome and another I use is ChromeDriver which uses a visible Browser process, to perform the User actions. And don't forget to have Exception Handlers, which scans the Webpage for appearing errors, while in use.

There are a lot of pitfalls, due to possible changes in the Design from Google, which lets your Software break. But there are also some ways to handle that. =) And create an XML containing all valueable information about an app, which comes in handy, when continueing to the next step.

You can create a Maven Plugin. This you can load into your Continuous Integration Server. I hope I could help you a bit.

like image 35
Semo Avatar answered Oct 15 '22 11:10

Semo