I use the below command in order to generate a signed APK, I'm pretty sure this worked a few months ago:
$ ionic cordova build android --prod --release --keystore="./my-keystore-file.keystore" --storePassword=mypass [email protected] --password=mypass
However, only an unsigned APK is generated. How can I generate a signed APK using ionic?
Running with Cordova The Ionic CLI can build, copy, and deploy Ionic apps to Android simulators and devices with a single command. It can also spin up a development server, like the one used in ionic serve , to provide live-reload functionality.
Generating an AAB in Android Studio To create an AAB binary locally using Android Studio, open the Build menu, then choose “Generate Signed Bundle / APK.” Follow the prompts to sign the AAB with your keystore file. For complete details, view the Android documentation.
You need to include -- --
before the Cordova-specific arguments:
$ ionic cordova build android --prod --release -- -- --keystore="./my-keystore-file.keystore" --storePassword=mypass [email protected] --password=mypass
The build android --prod --release
options are handled by the Ionic CLI, whereas everything after the first --
is passed to the Ionic Cordova plugin. Then everything after the 2nd --
is passed to Cordova itself.
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