The steps to setup the iOS development environment and to create a PhoneGap with iOS as target are very similar to the Android setup. Follow these steps:
Navigate to the
bin/ios
folder of the current PhoneGap installation and launch the./create
tool:$ cd phonegap-phonegap-2.0.0/lib/android/bin $ ./create ~/PhoneGapProjects/PGGettinStarted/ch01/ios com.gnstudio. samples.cordova.hello HelloPG
The syntax is the same as the
./create
command used for Android with the exception of the target path, which is a subfolder of the iOS one. The result is a folder structure familiar to Objective-C developers:|-HelloPG |-HelloPG.xcodeproj |-build |-cordova |-www
Run the
./emulate
command from thecordova
folder, the result is that the iOS emulator is opened without the need to open XCode with the PhoneGap app running:$ cd ~/PhoneGapProjects/PGGettinStarted/ch01/ios $ ./emulate
You created a PhoneGap project using iOS as the target platform and emulated the app using the iOS Emulator.
Note
If you are on Windows and you want to be able to use the Linux syntax used throughout this book you can download and install Cygwin from http://www.cygwin.com/.