PhoneGap on ubuntu for Android app development

I have installed PhoneGap 3.0.0 on Elementary OS Luna.

Installation Process

  1. Upgrade npm

    • npm update npm -g
    • sudo npm install n -g
    • sudo n stable
  2. Install phonegap
    sudo npm install -g phonegap
  3. Run ‘android’, select a target (e.g. “Android 4.2.2 (API 19)”), and click the “Install 8 packages” button.
  4. Download the Android sdk from
    • sudo mv ~/Downloads/ /opt/
    • cd /opt
    • sudo unzip 
    • sudo chmod -R 777 /opt/
  5. Update PATH in ~/.bashrc to include the phonegap tools:
    # Path to android sdk
  6. Install ANTsudo apt-get -u install ant

Create an app

  1. Create app
    • phonegap create my-app
    • cd my-app
  2. Run the app
    • phonegap local run android

      If this didn’t work  (popping-up an error message) – we needed an emulator to be set up. In Android util, go to Tools -> Manage AVDs, use the New button to create a new AVD, then Start the AVD. First time it failed to get start kill it and run once again.

    • phonegap local build android
      phonegap install android