I am trying to generate release apk file using cordova 11 with build.json file. Cordova generates aab file instead apk. Here is the command I have used
cordova build android --release
I am trying to generate release apk file using cordova 11 with build.json file. Cordova generates aab file instead apk. Here is the command I have used
cordova build android --release
Finally, I have the answer! Use:
cordova build android --release -- --packageType=apk
Got this answer from a youtube user called Harag. Thank you Harag.
Build with cordova command:
cordova build android --packageType=apk
It will create .apk in debug mode and depending on cordova version in release. You can also create .aab and use bundletool (see android bundletool) to extract apks like this:
bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
Confirming that the command that produced .apk is
cordova build android --release -- --packageType=apk