cordova create <app_name>
. cordova platform add android
cordova ripple android
.I know from docs that I can setup eclipse and do the build. (I'm not looking for this)
But I cannot create .apk file using the command cordova build android
. When I run the command, there is not output on the command line, the command just finishes. I cannot locate the .apk file.
Is there a way in which I can create an .apk file from command line? (Looking for suggestions for other platforms as well)
Thanks,
Open up VS Code, click the extension icon on the left-hand side and search for "Cordova Tools". Install it and reload VS Code, as asked. Next, click the debug icon on the left-hand side and click the gear icon at the top of the Debug panel and select "Cordova" in the dropdown at the top. This will create a launch.
You should get a more verbose output by running cordova -d build android
.
Alternatively, to use the underlying cordova-android scripts to build, you can:
cd platforms/android
./cordova/build
OR, to peel away even more layers, you can use the Android ANT script to run the build (which is what the cordova scripts shell out to anyways):
cd platforms/android
ant debug
For Android the default location for the APKs is the bin directory
The location is defined by ant properties in the Android SDK buil.xml
<import file="${sdk.dir}/tools/ant/build.xml" />
The output apk will be in two formats debug or release
<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-debug.apk" />
<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-release.apk" />
The location of your apk will be something like this:
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