PhoneGap – Getting Started using Xcode 

  1. Download and install NodeJS and PhoneGap
  2. Type this in Terminal: (make sure you have a stable internet connection because this will affect the generation of the code like missing libraries, invalid structures of directories etc.)
    Screen Shot 2013-10-03 at 7.35.52 PM
    You have to do this project creating and building on command prompt because in later versions of XCode, they do not give you to choose Cordova application or PhoneGap application when you start a new project like shown in this picture:
    Screen Shot 2013-10-03 at 8.55.02 PM
  3. Find the .xcodeproj and run it (it will be opened automatically in XCode)
    Screen Shot 2013-10-03 at 7.39.28 PM
  4. And then Run the project (by pressing the button on the top left) and you will get this
    Screen Shot 2013-10-03 at 7.49.22 PM
    You can modify the index.html or .js scripts and see how they look in simulator.An error usually occurs (the error message would be “index.html not found” when there is no index.html in www directory or the structure of the directory is not like shown below.Screen Shot 2013-10-03 at 7.59.58 PM

Note:

  1. The version I’m using is Xcode 5.0, iOS Simulator 6.1, PhoneGap 2.9.0 and node.js v0.10.20. Running on Mountain Lion 10.8.5
  2. If you are using different versions in either of one of them, the result might be slightly different
Advertisements