View
 

Getting Started with PhoneGap (iOS) - Xcode 3

Page history last edited by Steve Gill 9 months, 4 weeks ago
This tutorial provides instruction on setting up 0.9.5 PhoneGap for your web application on an iOS device using Xcode3

For information regarding setting up PhoneGap with Xcode 4, click here.

For information on setting up an iOS device for development, see the iOS Dev Center.

 

Requirements

 
  • Intel-based computer with Mac OS X Snow Leopard (10.6) with Xcode and the iPhone SDK installed.  Make sure to install the default with the UNIX tools included.
  • an Apple iOS device (iPhone, iPad, iPod Touch)
  • iOS developer certification. (only necessary to install apps on an iOS device)

 

Step 1

 

  • Download the latest copy of PhoneGap and extract its contents. We are only interested in the iOS directory
  • Run the installer until completion.  (Make sure Xcode is closed)
  • Launch Xcode then under the File menu, select "New Project..."
  • Navigate to the "User Templates" section, select PhoneGap, then in the right pane, select "PhoneGap-based Application"

   

  •  Select the "Choose..." button, name your project and choose the location where you want the new project to be.
  • Modify the contents of the "www" directory to add your HTML, CSS and Javascript.
  • Open [AppName]-Info.plist and change "BundleIdentifier" to the identifier provided by Apple. If you have a developer license, you can access and run the Assistant at http://developer.apple.com/iphone/manage/overview/index.action and register your App. If you do not have a developer license and simply wish to test PhoneGap on your desktop simulator, you can skip this step.

 

  • IMPORTANT: Make sure to change the Active SDK in the top left menu from "Use Base SDK" to Device+version#. If for whatever reason, the top left menu says "Base SDK missing", you have to first set the Base SDK in the the project settings.

    • Project -> Edit Project Settings.
      Then choose the tab called "General".
      Under "Base SDK for All Configurations", select "iOS Device 4.x" or "Latest SDK" 

                   Restart xCode

 

 

 

  • Build and Go.

     

 

Step 2

 

  • Open [AppName]-Info.plist and change "BundleDisplayName" to the name of your web application.
  • Replace icon.png with your web application's icon 57 by 57 pixels

     

 

  • Change Default.png 320 by 480 pixels. (optional)

  •