Wednesday, December 4, 2013

How to Install PhoneGap in Mac and Create an iOS Project.

Please follow the steps below to install PhoneGap in mac OSX and create an iOS project.

Step 1 - Download and Install Node.js

Step 2 - Goto PhoneGap download page in your browser and download the latest version of PhoneGap and UnZip it.

Step 3 - Open Terminal in your mac and navigate to the folder where you downloaded PhoneGap.

Step 4 - From there navigate to the path in terminal \phonegap-2.9.1\phonegap-2.9.1\lib\ios\bin

Step 5 - Type the following command in Terminal

./create ~/Desktop/MyPhoneGapApp com.companyname.myphonegapapp MyPhoneGapApp

Parameters of the create command are

1 -
"~/Desktop/MyPhoneGapApp" Path to create new project
2 - "com.companyname.myphonegapapp" bundle name
3 - "
MyPhoneGapApp" Project nameThis will create an iOS PhoneGap project named MyPhoneGapApp in Desktop :)

4 comments:

  1. I imagine I'm just overlooking something, but where on the phonegap download page is there an option to download version 3.2? I am only able to install phonegap via the command line, and when I do, I am not certain where it is placing the directory on the Mac.
    I also am unable to hook up with xCode.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Q - Where on the phonegap download page is there an option to download version 3.2?

    It is not available. You should use commandline to install or update the latest version. Use the following command.

    $ sudo npm install -g phonegap

    Following command is to create the project. Make sure that you are in the directory where you are managing the sourcecode.

    $ phonegap create hello com.example.hello HelloWorld

    ReplyDelete
  4. Adarsh, Thanks for the step by step. Here's a guide one of our developers wrote, you might find it interesting. http://www.panopticdev.com/blog2014/phonegap-mac-osx-setup-configuration-android-ios/

    ReplyDelete