Continuous Integration & Deployment for Android apps

February 22, 2018

Continuous Integration & Deployment for Android apps

Delivering Android apps can be a pain in the neck.

Preparing builds, signing the release, messing with the store – all this stuff require extra effort that could well be invested into actual coding.

But what if the whole process looked like this:

Pipeline examplePipeline example

This is called Continuous Delivery: a process that allows developers to produce valid builds ready to be published to the app store on a single push to branch.

And this is exactly what Buddy does.

In this guide, we are breaking it down the to a simple list of how-to steps and show you how easy it is to implement even advanced DevOps strategies with Buddy.

Step 1: Build APK on every push

Before you start

The core of Continuous Delivery is version control. Buddy supports all popular Git hosting providers, including GitHub, Bitbucket and Gitlab. You can also use your own private server of host code directly on Buddy. If you are new to Git, this guide will get you started in no time

The basic concept of Buddy's development automation are Pipelines. Pipelines have steps called actions. There are three dedicated actions for Android Continuous Delivery:

  • Build APK
  • Sign APK
  • Publish to Google Play

Let's start with adding a pipeline that will be executed on every push to the Staging branch:

Adding new pipelineAdding new pipeline

Once you configure the pipeline, Buddy will ask you about the first action to be added to the newly created pipeline. Select the Build APK action from the Android section.

First, Buddy asks about the SDK Version and Build Tools Version to be used for building the APKs:

Action detailsAction details

On the next screen you can adjust build commands in case your project requires other steps besides ./gradlew assembleRelease (e.g. unit tests)

Run tabRun tab

Also, if you need to preinstall additional dependencies besides SDK and Build Tools, you may add them in the Environment Customization tab:

Environment customizationEnvironment customization

If you are good with the configuration, just hit the Add this action button.

Congratulations! From now on, Buddy will automatically build the APK on every push to the Staging branch.

Step 2: Sign the APK for release

Every app store requires developers to sign their applications before publishing them. In many cases the signing is a part of the building process, which means the key & keystore are located in the application repository.

For security reasons storing the keys in the repository is not recommended – that's why Buddy has a dedicated action for signing the APKs.

Before adding it to our pipeline, however, we have to upload the keystore to the pipeline filesystem.

Filesystem detailsFilesystem details

Once the keystore is uploaded, click the [+] button after the Build APK action and select Sign APK from the actions menu. Then you can select the path of the APK in the filesystem (by default it's /app/build/outputs/apk/release) and provide the keystore with its password.

Action detailsAction details

Awesome! We have expanded the pipeline. Once new code is pushed to the Staging branch, the pipeline will automatically build and sign the APK. The signed APK by default is saved in the pipeline root as signed-app.apk. The location and name can be changed in the Sign APK settings.

Step 3: Publish to Google Play

On this stage our Android application is already built and singed. Now it's time to publish it to Google Play.

Buddy has a dedicated action for publishing APK. Once again, click [+] at the end of the pipeline and choose the Publish to Google Play action from the actions menu.

Action detailsAction details

In this action we have to set up three things:

  • Location of the APK to publish
  • Deployment track
  • Service account details

We're going to publish the APK processed in the previous action. Use the Browse option and locate signed-app.apk in the pipeline filesystem.

Next, since our pipeline is assigned to the Staging branch, we shall publish it to the Track Beta.

The final step is adding the Service account key at the bottom of the action.

If you don't have such key already, check out our guide how to create a private key and set up permissions for Google Play

With everything in place, click Add this action to see the pipeline in its final form:

Pipeline examplePipeline example

Final Result

Congratulations! You have just automated the whole Android delivery – from APK build to Google Store deployment. Make the final push to Stage and watch Buddy seamlessly perform all steps:

Other scenarios

Buddy Pipelines are very flexible and powerful which makes other use cases very simple to introduce. Here are a few examples:

Build and deliver Android to email, Slack channel or phone number

Instead of deploying the APK to Google Play, you can build and send it to many communications channels supported by Buddy.

Communication ChannelsCommunication Channels

In this case our starting point is a pipeline with just the build action as we don't need to sign or publish our APK.

Go to the pipeline filesystem and locate the APK. Copy the link from the Download option:

Notification actionsNotification actions

Now add a notification action of your choice, like Slack, Email or SMS, and paste the link in the message body:

Setting up a notification actionSetting up a notification action

On every build Buddy will send the message with the link to the APK attached. You can use that link to install the application on an Android device directly from the filesystem.

Build, test and approve an APK before publishing

Some scenarios may require approval before publishing – for example from the QA team. In Buddy you can add an action that will put the pipeline on hold until approved.

Here's an example of a pipeline with such action applied before the final delivery step:

Pipeline examplePipeline example

And this is how the pipeline looks executed and waiting for approval from the QA:

Execution progressExecution progress


Buddy gives practically unlimited flexibility when it comes to creating delivery workflows. Pipelines can be triggered manually (useful for deployments to Production), on every push (useful for development) or recurrently (useful for integration tests). It turns the menacing concept of DevOps to a breeze, letting you easily introduce Continuous Delivery so that you can deliver, iterate and publish your software faster, giving you more time for what's really important – building awesome apps.

If you're interested in introducing Buddy to your workflow, let us know on the live-chat or directly at – we'll help you to get started in no time.

Alexander Kus

Alexander Kus

Customer Success Manager

A story-teller and conversation-lover, Alexander decided to invest his skills to help his friends at Buddy transform the cold language of patch notes into exciting narratives. Also: an avid gamer, hip-hop DJ, Liverpool FC fan, absentminded husband, and the father of two.

With Buddy even the most complicated CI/CD workflows take minutes to create

Sign up for Buddy CI/CD

Start a free trial

Trusted by customers from 170+ countries