This post describes, how to set up your development environment for PhoneGap and run a sample Hello word application.
Downloading and Installing PhoneGap
Download the phoneGap from www.phonegap.com and you will see a button to install the latest version of PhoneGap. Clicking on this, will prompt the download of a ZIP file containing everything you need to get started.
Unarchive the downloaded folder, and you might want to save it somewhere safe on your hard drive. And that’s all there is to installing PhoneGap.
Creating Sample project in Xcode
- Open terminal application.
- Go to the directory where you maintain Unarchived phoneGap-2.9.1 folder.
- The folder gives us number of folders, each labelled with the targeted OS.
- Now lets consider application for iOS, for this go to the bin folder. ( phonegap-2.9.1/lib/ios/bin )
- To generate project run the following command in terminal.
./create <Project location> <bundle identifier> <Project name>
For Ex -./create /Desktop/HelloWord com.cuelogic.HelloWord HelloWord_PhoneGap
- You’ll find a HelloWord folder on your desktop. Open it up, go to the “www” folder and take a look at the files and folder inside it, as shown in the image below:
- Go back to main folder and open the HelloWord_PhoneGap.xcodeproj file in Xcode. Build and run the application on simulator. Your application will look similar as the image shown bellow:
Finally you have done with your first phoneGap application.