3

I've got a Phonegap/Cordova 3.0 app that I am testing on Android.

Since version 2.x, Cordova relies heavily on the command-line terminal. I've done all the setup stuff and I can build the app. But two things are troubling me.

First of all, an Android project has two www folders. One is [myproject]/www. The other is [myproject]/platforms/android/assets/www. I'm not sure which of these folders to edit when I am fixing bugs.

If I am correct, the first one is where you place your app files before using the command-line "cordova build" to create the app. The second one should then be only a copy that's used after building, before deploying.

Now my question is, when I make a change to my app and I want to test on device, do I have to use the command line to (re)build the app every time?

Wytze
  • 7,844
  • 8
  • 49
  • 62

3 Answers3

5

I found a solution: in command-line terminal, type cordova run android and the app will be built, deployed and run on device.

Wytze
  • 7,844
  • 8
  • 49
  • 62
5

[myproject]/www is the directory in which you should put your source files. When you build your app these files are copied in to [myproject]/platforms/[platform]/assets/www. In addition to this, files in [myproject]/platforms/[platform] are also copied to [myproject]/platforms/[platform]/assets/www, which allows you to create per-platform overrides to your files.

Note that you should never edit files in [myproject]/platforms/[platform]/assets/www directly, as they will be deleted next time you build your project.

To run your project on your device use cordova run [platform], or to run it on an emulator use cordova emulate [platform].

0

Hi First thing : Edit www folder inside the asset folder. Second : no need of command line build , you can take build via eclipse its very easy, Right click on project root folder --> Run As -> Android Application

Arjun T Raj
  • 3,187
  • 1
  • 21
  • 44
  • You're right there Arjun, but won't those files be overwritten next time I build using the command-line? It doesn't seem like the right solution. – Wytze Aug 27 '13 at 08:50