I have found many many confusing answers on this one: How do I sign (release/debug) android app without Android Studio (E.g. when signing ionic/cordova/phonegap app)?
You can Add Key store in Gradle file.
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
--> use CMD for generate signed APK.
gradlew assemblerelease.
So, the right and simple answer to date is:
cd into your project platform/android folder (might just be your main project folder if not cordova/ionic build). You should find your main build.gradle file in that folder.
Create a keystore file by calling:
keytool -genkey -v -keystore <KEYSTORE_FILE_NAME>.keystore -alias <ALIAS_NAME> -keyalg RSA -keysize 2048 -validity 10000
Follow along and fill in <ALIAS_NAME> and passwords (write them down in a place you'll find them!)
Create two files named: debug-signing.properties
and release-signing.properties
Enter the following configuration to both (you can later change the keystore to harden the security for release build...):
keyAlias=ALIAS_NAME keyPassword=ALIAS_PASSWORD storeFile=KEYSTORE_FILE_NAME storePassword=KEYSTORE_PASSWORD`
Run build ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With