Sign using keystore for your quasar cordova app
Hi friends! in this article i am going to show how to sign the quasar cordova app with simple steps. Most of people have been troubled to sign there mobile app in order to publish to the store. So the signing part is pretty much easy. Follow these steps
First of all you need to have JDK installed. if you have JDK its fine. Or else go to following link and download JDK
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
After that you have to set the environment variable for the JDK path. So follow below steps to do that
- Right click on My PC
- Go to properties
- Click on Advanced system settings
- Click environment variables
- Select Path and click edit
- Create new path for your JDK bin folder
Now create new folder to save your project keystore files. And open with CMD and type following commands. Keep those keystore files generated in a safe place. because those may need later on.
keytool -genkey -v -keystore quasar-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias quasar-release
keytool -importkeystore -srckeystore quasar-release-key.jks -destkeystore quasar-release-key.jks -deststoretype pkcs12
keytool -genkey -v -keystore quasar-debug-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias quasar-debug
keytool -importkeystore -srckeystore quasar-debug-key.jks -destkeystore quasar-debug-key.jks -deststoretype pkcs12
Now go to your quasar cordova project. If you havent created a project yet follow this link to get start with quasar cordova.
So now copy and paste the generated keystore files called (ex:- quasar-debug-key.jks and quasar-release-key.jks) in to your root directory of quasar (Not src-cordova)
And you have to remember to add those files to .gitignore
Now in the same quasar root directory create a json file called build.cordova.json and type following codes to identify the keystore files by quasar.
{
"android": {
"debug": {
"keystore": "../quasar-debug-key.jks",
"storePassword": "your-password",
"alias": "quasar-debug",
"password" : "your-password",
"keystoreType": "jks"
},
"release": {
"keystore": "../quasar-release-key.jks",
"storePassword": "your-password",
"alias": "quasar-release",
"password" : "your-password",
"keystoreType": "jks"
}
}
}
So as the final step, you have to modify the package.json file with following codes
{
"scripts": {
"lint": "eslint --ext .js,.vue src",
"test": "echo \"No test specified\" && exit 0",
"cordova:dev": "quasar dev -m cordova -T android -- --buildConfig=\"../build.cordova.json\"",
"cordova:build": "quasar build -m cordova -T android -- --buildConfig=\"../build.cordova.json\""
}
}
Then you have to run the project using yarn cordova:dev to sign the app on run
Thats it!! . If you have any question please comment below. If you want to see latest articles go to following link