Bamboo + Android + Gradle : how to produce signed apk?

1.6k Views Asked by At

Newbie with Bamboo trying to produce .apk for android application. I have done the checkout and gradlew build tasks for default job, so the download and build process is fine.

What I need is to be able to produce signed .apk file and deliver it in someway to other part of our team. Thinking about modify the gradle script to produce signed .apk with keystore/password and so, but not sure how to configure Bamboo to serve the .apk.

Any help much appreciated.

1

There are 1 best solutions below

0
On

Building a signed APK is a function of your Gradle build script and not Bamboo. Based on the information available here, this is how I build a signed APK using Gradle. The information under the "Signing Your App in Android Studio" section is particularly helpful to create the keystore and the key necessary to sign the APK.

// APK signing configuration
android.signingConfigs {
    MobileApp {
        storeFile file("${rootDir}/TempKeyStore.jks")
        storePassword "********"
        keyAlias "********"
        keyPassword "********"
    }
}

// Build types - debug and release both use signing config above to 
// sign the resultant APKs
android.buildTypes {
    debug {
        signingConfig android.signingConfigs.MobileApp
    }
    release {
        signingConfig android.signingConfigs.MobileApp
    }
}

Once you have your Gradle build script configured to build a signed APK, Bamboo can be easily configured to run your Gradle build script.