You can define the signing configuration to sign the apk in the build.gradle file.
You can define:
storeFile : the keystore file
storePassword: the keystore password
keyAlias: a key alias name
keyPassword: A key alias password
You have to define the signingConfigs block to create a signin...
You can define the signing configuration in an external file as a signing.properties in the root directory of your project.
For example you can define these keys (you can use your favorite names):
STORE_FILE=myStoreFileLocation
STORE_PASSWORD=myStorePassword
KEY_ALIAS=myKeyAlias
KEY_PASSWOR...
You can store the signing information setting environment variables.
These values can be accessed with System.getenv("<VAR-NAME>")
In your build.gradle you can define:
signingConfigs {
release {
storeFile file(System.getenv("KEYSTORE"))
storePasswo...
The simplest and cleanest way to add an external configuration is through a separate Gradle file
build.gradle
apply from: './keystore.gradle'
android{
signingConfigs {
release {
storeFile file(keystore.storeFile)
storePassword keystore.storePassword
...