Is it possible to build Phonegap application in release mode?
As I can see command "phonegap build android" always builds apk package in debug mode.
Why?
Is it possible to build apk package in release mode using "phonegap build android" command?
Is there some "--release" argument for "phonegap build" command?
Or should I use "cordova build --release" command only?

- 16,295
- 33
- 103
- 133
1 Answers
In PhoneGap 3.4.0 you can call:
cordova build android --release
If you have set up the 'ant.properties' file in 'platforms/android' directory like the following:
key.store=/Path/to/KeyStore/myapp-release-key.keystore
key.alias=myapp
Then you will be prompted for your keystore password and the output file (myapp-release.apk) ends up in the 'platforms/android/ant-build' directory already signed and aligned and ready to deploy.
Also:
Found part of the answer here, at Phonegap documentation. The full process is the following:
Open a command line window, and go to /path/to/your/project/platforms/android/cordova.
Run
build --release
. This creates an unsigned release APK at /path/to/your/project/platforms/android/bin folder, called YourAppName-release-unsigned.apk.Sign the APK using the instructions at android developer official docs.
Thanks to @LaurieClark for the link (http://iphonedevlog.wordpress.com/2013/08/16/using-phonegap-3-0-cli-on-mac-osx-10-to-build-ios-and-android-projects/), and the blogger who post it, because it put me on the track.

- 1
- 1

- 3,282
- 7
- 41
- 64
-
But why there are two tools - phonegap and cordova? Why to create phonegap project I should use phonegap tool, but to build - cordova tool? – Volodymyr Bezuglyy May 05 '14 at 08:34
-
PhoneGap is a distribution of Apache Cordova. You can think of Apache Cordova as the engine that powers PhoneGap, similar to how WebKit is the engine that powers Chrome or Safari. Over time, the PhoneGap distribution may contain additional tools that tie into other Adobe services, which would not be appropriate for an Apache project. PhoneGap will always remain free, open source software and will always be a free distribution of Apache Cordova. Currently, the only difference is in the name of the download package and will remain so for some time. – Shereef Marzouk May 05 '14 at 08:37
-
Commands "cordova create" and "phonegap create" create different projects. There are a lot of files in phonegap project, that are absent in cordova project. config.xml are also totally different. So, should I create phonegap application using command "phonegap create" but build phonegap application using command "cordova build"? – Volodymyr Bezuglyy May 05 '14 at 12:03
-
But in any case there is command "phonegap build". And this command builds only debug apk, not release. Why? – Volodymyr Bezuglyy May 05 '14 at 16:32
-
I use PhoneGap 3.4.0-0.19.19. And there is no "phonegap build android --release" command in this version. Or this command does not work properly. As I can see this command builds apk in debug mode. – Volodymyr Bezuglyy May 05 '14 at 16:36
-
does `cordova build android --release` build in debug mode also ?? – Shereef Marzouk May 12 '14 at 04:53