How to setup phonegap on linux for Android

It is very easy to setup phonegap on Linux for Android. Just follow the steps given below.

  1. Download the Android SDK ADT bundle for Linux. This bundle includes
    • Eclipse + ADT plugin
    • Android SDK Tools
    • Android Platform-tools
    • The latest Android platform
    • The latest Android system image for the emulator
  2. You need to add the path of your Android SDK platform-tools and tools directory. In my example I will use “/Development/android-sdk-ubuntu” as the directory the SDK is installed in.
  3. Open the .bashrc file, and Add the following line at the end:
    export PATH=${PATH}:/Development/android-sdk-ubuntu/platform-tools:/Development/android-sdk-ubuntu/tools
  4. open the terminal and execute the command
    exec bash
  5. This will execute the bashrc file and add the SDK path to your $PATH variable. To make sure it is added try
    echo $PATH

    from the terminal.

  6. Download and unzip phonegap
  7. In a terminal window, navigate to the bin directory within the android subfolder of the Cordova distribution.
  8. Type in
    ./create   

    then press “Enter”

The 9th step will create your first phonegap project on linux for Android.

In my example

./create /u/works/Hello_World com.helloworld.cordova Hello_World

I just tried this on Ubuntu Linux, and this very same steps should work on all other distributions of Linux. Try yourself.

Leave a Reply

Your email address will not be published. Required fields are marked *