app/
directory. And ensure the key password is the same as the keystore password.keytool -genkey -v -keystore ci-key.keystore -alias ci-key-alias -keyalg RSA -keysize 2048 -validity 10000
app/build.gradle
file add this to the android block:signingConfigs {
ci {
keyAlias "ci-key-alias"
keyPassword System.getEnv("CI_KEYSTORE_PASSWORD")
storeFile file("ci-key.keystore")
storePassword System.getEnv("CI_KEYSTORE_PASSWORD")
}
}
android
block, create a new build variant, initalised as the debug variable, called debug_with_ci_keystore
:buildTypes {
debug_with_ci_keystore.initWith(buildTypes.debug)
debug_with_ci_keystore {
if(System.getenv("CI_KEYSTORE_PASSWORD")) signingConfig signingConfigs.ci
minifyEnabled false
}
...
}
ci
signing config above if we have the correct environment variable, CI_KEYSTORE_PASSWORD
. This means, if we don't, we only create app/build/outputs/apk/app-debug_with_ci_keystore-unsigned.apk
, not the signed app-debug_with_ci_keystore.apk
../gradlew build
, if we have CI_KEYSTORE_PASSWORD
set in our environment, we will create app/build/outputs/apk/app-debug_with_ci_keystore.apk
, which will have a constant keystore.release
, although you may not want to keep your release keystore in your repository.android android-keystore keytool
Page 1 of 1