2016-11-02

TFS: Automate deploy Xamarin Android project to Google Play Store

TFS (also VSTS) is able to build, test and deploy your .net projects. Below you will find simple tutorial how to build and deploy Xamarin Android app on Visual Studio Team Services and automate deploy to Google Play Store. 

Actions on Google play / Google developer console

Important: Before automating deploy application needs to be deployed manually for the first time:

Go to google play dev console, create new project, upload apk into alpha tests

Fill all necessary fields (icons, images, set catrgories) and deploy:



Enable api access to google play developer console:
Connect Google Developer poject with play console:
Create account:

Set proviliges:

(Administrator is probably too much, but i didnt have time for checkin other )

Download Google Play Android developer json, it will look like this:


Add necessary files to solution and deploy

Generate keystore file

and add it to solution (the file isused to sign your apk file so do not share it with others )

TFS

Install Google play from Visual Studio Marketplace


Go to settings ->; Services
Add new service endpoint: Google Play


Service Account email: take email address from Google Play Console
Private kay: Take it from downloaded json from google developer console.
You can download the file from here:


Open json file and take copy private kay to TFS: 




Go to Build & Release, add new build definition: Xamarin.Android:


Enable Apk sign and align


Add new build step: Google Play Release


And configure it:

Done. Save and Start build.