how to install phonegap 3.3.0

This blog will guide you on how to install phonegap 3.3.0 on windows and mac machine.

How to install phonegap 3.3.0 on windows
Step 1: Go to url phonegap.com/install/, now click “NodeJS” link to install node.js file and npm. It will download .msi file install that msi file on windows machine.
Step 2: Now restart your computer (windows problem), so that environment variable get sets automatically.
Step 3: Now go to command line and execute command “npm install -g phonegap”.
Step 4: Now you are done with installation. execute the command “phonegap create my-app” it will create my-app folder.
If its create it means you are done with installation for windows.

How to install phonegap 3.3.0 on MAC
Step 1: Download and install nodejs from http://nodejs.org/
Step 2: Make sure that /usr/local/bin is in your $PATH. To check type the following in the Terminal:
sudo pico /etc/paths .
A list of paths will be visible. Add /usr/local/bin to the top and press enter if it isn’t present.
/usr/local/bin
Step 3: Open the Terminal and type the following to get to the root, then press Enter:
cd ~
Step 4: Type the following to open the .profile hidden file, and then hit Enter (vi = visual editor):
vi .profile
Step 5: Type i. — INSERT — should appear, telling you what mode you are in (you were in the command mode earlier).
Type the following on separate lines. Do NOT hit Enter when you are done:
# for NODE
PATH=”${PATH}:/usr/local/bin”
export PATH
# for npm
PATH=”${PATH}:/usr/local/bin/npm”
export PATH

Step 6: Press the ESC key to enter command mode.
Type the following command to write the files and hit Enter:
:w
Step 7: Quit the vi editor by typing:
:q

For Android:
Step 1: Open up Terminal and drag the tools folder present in the adt-bundle folder to it. Make a note of the folder path.
/Users/synechrontech/Desktop/adt-bundle-mac-x86_64-20130729/sdk/tools

Step 2: Follow steps 4-6 above, but use the arrow keys to get to the end of the previous entries, then starting on a new line with Enter, enter your PATH information like this (you can actually copy/paste in the information in the Terminal window from your own notes). You’ll need two entries, one to the tools folder and the other to the platform-tools folder:
# for android
PATH=”${PATH}:~/Developer/adt-bundle-mac-x86/sdk/tools:~/Developer/adt-bundle-mac-x86/sdk/tools”
export PATH
# for adb
PATH=”${PATH}:~/Developer/adt-bundle-mac-x86/sdk/platform-tools:~/Developer/adt-bundle-mac-x86/sdk/platform-tools”
export PATH

Step 3: Press the ESC key to enter command mode.
Type the following command to write the files and hit Enter:
:w
Step 4: Quit the vi editor by typing:
:q
In the step above be careful to add your path of the adt bundle in PATH.
After completing all the above steps:
1) Open Terminal and type the following command in the root folder:

sudo npm install -g cordova

2) To create a project type the following command in the Terminal:

cordova create hello com.example.hello “HelloWorld”

Your path in the Terminal should be set to the Folder you want the project to be created in.

3) The type the following in the Terminal:

cd hello

4) To add a particular platform type the following in the Terminal:

cordova platform add ios

5) To build the application type the following command in the Terminal:

cordova build ios

Let me know if you need any help or not able to configure.

Share this nice post: