Setting Up PhoneGap on Ubuntu


I decided to revisit phonegap as an option for developing mobile appliations. Here are some gotchas I ran into while setting up PhoneGap on Ubuntu 14.04 LTS. This might be relevant for installing apache cordova stand-alone as well, though I have not tried this.

The install page assumes you know that you need to install the SDK for the platform you want to test on. You can download the android SDK here. The SDK’s sdk/tools/ and sdk/platform-tools/ directories have to be on the system’s PATH, which can be accomplished with:

$ export PATH="/path/to/sdk/tools/:$PATH"
$ export PATH="/path/to/sdk/platform-tools/:$PATH"

If you want to have this added to your $PATH automatically, add the above lines to `~/.bash_profile.

You also have to create an Android Virtual Device to have PhoneGap use. To do this, run the android script which is found in the sdk/tools directory. The default interface only shows you which platform SDKs you have installed, to create a virtual device, use the wizard accessed from the Tools > Manage AVDs… menu.

Be careful when allocating android virtual devices; if your system does not have as much free memory as the device image requires, the manager will automatically reduce the memory allocated and give you an appropriate warning.

However, I could not get a Nexus 4 or Nexus 5 image to boot after the system had automatically reduced the allocation. The loader will appear to make progress booting the image (with a “this may take a while” message), but would not load for me even after 45+ minutes. Choosing an image that had little enough memory that it was not automatically reduced during launch, or manually setting the memory to a suitable low value, prevented this.

Get Notified of New Posts

* indicates required