This is just some notes I made, mostly taken from

I was installing PhoneGap 3.0.0 on Ubuntu 12.04.

I use Sublime Text 3 for development, so didn't want any of the Eclipse-based tools.

NB : I've revised these notes a bit, to be clearer about what needs to be installed, with 2 options for installing nodejs, and to give a more logical order to the steps..


First, check you've got Java and Ant installed - you'll need those later:

sudo apt-get install default-jre
sudo apt-get install default-jdk
sudo apt-get install ant

Next, install node from source:

git clone
cd node
git checkout v0.10.26 #Try checking for what the stable version is
./configure && make && sudo make install

Alternatively, upgrade npm, and get the latest nodejs (by installing 'n' and running that):

sudo npm update npm -g
sudo npm install n -g
sudo n stable

Now install phonegap itself using npm:

sudo npm install -g phonegap

Download the Android sdk from, and unpack it somewhere (I had problems with file permissions when I put it under /opt, so I ended up putting it under my home directory, as ~/android):

mv ~/Downloads/ ~/android
cd ~/android

Update PATH in ~/.bashrc to include the phonegap tools:

# Add android sdk

and then 'source ~/.bashrc' to make sure you've got the new path setup.

Create an app

Create a phonegap app (I use a "projects" subdirectoy):

cd ~/projects
phonegap create my-app
cd my-app 

Run the app

Before you run the app, you'll need to set up an emulator - run the android tool:


You may need to select a target (e.g. "Android 4.2.2 (API 17)"), and click the "Install 8 packages.." button (may need several clicks to accept all the licences)

Now setup and start an emulator - in the 'android' util, go to Tools -> Manage AVDs, go to the "Device Definitions", select a device, and use the "Create AVD" button to create a new AVD. Then use the "Start.." button to start the AVD (it may take a surprisingly long time to start fully).

Run the app:

phonegap local run android

You should see the app compile and install on the emulator.

You can do the compile and install steps separately:

phonegap local build android
phonegap install android

Deploying to a real phone

The emulator seems to run very slowly, and not give much sense of what the app will actually be like on the phone.

So, deploy the app - plug in Android phone via USB, select "USB debugging" in the Developer section of the settings on the phone, and the app will be installed on the phone when you next do "phonegap install..."

Add some plugins to the project

Once you get going, add some plugins to the project:

phonegap local plugin add
phonegap local plugin add