15

I don't understand where can I find my package that is compiled so I can copy it into my device and install it from there.

What I did is create an empty project, then made build on it with no errors, however, I cannot find .apk file.

\platforms\android\bin has HelloWorld-debug.apk but I don't want to debug package but a normal one.

I tried phonegap build android as well as phonegap build android local and no difference was found between these two commands. Also, why is it even named HelloWorld if I named my project lololol?

Sayed Mohd Ali
  • 2,156
  • 3
  • 12
  • 28
Stan
  • 25,744
  • 53
  • 164
  • 242

6 Answers6

20

You can change the name of the app after to create the project, in the file:

ProjectFolder/www/config.xml

After that, you have to build again the project. If you want the release version, go to

ProjectFolder/platforms/android/cordova

and then execute the command:

cordova build --release

This creates an unsigned release APK at ProjectFolder/platforms/android/bin folder, called YourAppName-release-unsigned.apk.

jgarciabt
  • 559
  • 1
  • 5
  • 19
  • 6
    I have done this, and I do not have a "bin" folder in that folder path. – Adam May 14 '14 at 17:24
  • Wich version of Phonegap/Cordova are you using? This is only for version 3.3. In the new version (3.4) your folder is called ant-bin, but it's the same – jgarciabt May 15 '14 at 07:09
  • 1
    I have "ant-build" is this the proper .apk file? The reason I'm asking is because the the "AppName" is different that what I've specified in the config.xml even after I've done a build again. – Adam May 15 '14 at 18:52
  • Yes, the .apk file is this folder, you can check it executing the app. I don't know why your app doesn't have the proper name… :S – jgarciabt May 16 '14 at 17:09
  • Are your sure is not at phonegap_project_folder/config.xml? – Marcelo Agimóvel Jan 29 '18 at 14:04
9

Phonegap 5.4.0 puts them in platforms/android/build/outputs/apk

I ran phonegap build --release to do this. Still trying to figure all this out however!

james-geldart
  • 709
  • 7
  • 9
4

Are you using eclipse? If so, take a look at this tutorial. This will allow you to export to a .apk file.

http://examples.javacodegeeks.com/android/core/build-android-application-package-file-apk-using-eclipse-ide/

Michael Marvick
  • 521
  • 4
  • 15
  • 2
    No, I'm using command line. Is there any way to generate `.apk` files using command line? – Stan Dec 16 '13 at 15:31
  • 2
    I've never done it before but it looks like these will tell you how to do it. Here's a guide to releasing from the command line: http://developer.android.com/tools/building/building-cmdline.html#ReleaseMode Here's a better guide to signing the .apk file, if you need to do that as well: http://developer.android.com/tools/publishing/app-signing.html – Michael Marvick Dec 16 '13 at 15:33
  • 1
    Yea, now I have `HelloWorld-release-unsigned.apk`. I still don't get it why it's called HelloWorld tho.. )) – Stan Dec 16 '13 at 15:40
3

Check out platforms/android/build.xml for where "HelloWorld" comes from, maybe. In my case, I have a line that says

<project name="CordovaApp" default="help">

and my app gets named "CordovaApp-release.apk", instead of what I have in config.xml. I assume the "cordova platform add android" is doing something slightly wrong, but not entirely sure.

Tony B
  • 915
  • 1
  • 9
  • 24
2

in the newest versions the apk file should be located at /platforms/android/app/build/outputs/apk/release/

Khaled Osman
  • 1,251
  • 12
  • 17
1

I am guessing they moved the location of the apk again. Here is my version and the new location:

>phonegap -v

8.0.0

location of apk after

>phonegap build android --release

[project_folder]\platforms\android\app\build\outputs\apk\release

Note the extra \app folder.

Community
  • 1
  • 1
trydent
  • 51
  • 2