Getting Started with PhoneGap (iOS)

The main steps are already detailed on the official PhoneGap site – http://phonegap.com/start.

Below are my tried and tested steps for your reference to get the iOS environment up and a test App running on a Mac OSX (Lion) machine. It is not intended to be comprehensive and there are more details available on the web. Once you got the environment up and deploy the test app to your device successfully, you can add in the steps to create a PhoneGap app from the official guide above.

Getting Started with Running an iOS App in XCode4

1) Ensure that your Mac machine is running on Lion OSX 10.7 Mac OS X 10.7 because XCode 4.2.1 with SDK 5 only runs on Lion.

2) Go to the App Store app on your Mac machine and search for XCode4 and install it.

3) Download and extract SimpleDrillDown.zip (a sample iOS app) by double-clicking it and it can be downloaded from: http://developer.apple.com/library/ios/#samplecode/SimpleDrillDown/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007416

4) Open the SimpleDrillDown folder and double-click on SimpleDrillDown.xcodeproj to load this project in XCode4.

5) From the dropdown box above, select the iPhone Simulator (any version 4.3 or 5.0). Click on Run to build and run the project.

6) iPhone Simulator will load and run the SimpleDrillDown app.

Configure to Deploy on An Actual Device (Done Once Only)

1) Login to iOS Dev Center (https://developer.apple.com/devcenter/ios/index.action) using your Apple ID. You must have a paid subscription (at USD$99 per year) to the iOS Developer Program in order to log into this portal.

2) Go to the iOS Provisioning Portal

The license is tied to ONE main Mac machine only. So if you are changing to a different Mac machine, be sure to revoke the Current Development Certificate in the Provisioning Portal first. Then follow the steps to generate the CSR to disk and submit and download and use the new Development Certificate.
However, a better way is to export the Development certificate with the private key and import into the 2nd Mac machine.

3) Scroll to the bottom to “Get your application on an iOS with the Development Provisioning Assistant” and click on “Launch Assistant” and click “Continue” and follow the steps.

4) Assuming all the necessary are set up, connect your iOS device to your Mac machine, e.g. an iPhone.

5) Open the SimpleDrillDown folder and double-click on SimpleDrillDown.xcodeproj to load this project in XCode4.

6) From the dropdown box above, select the first option which should be the name of your iOS device. Click on Run to build and run the project.

Adding Another Device

1) Connect the new device to the Mac machine.

2) Open XCode4 and go to Window -> Organizer.

3) Select the new device from the list and click on the “Add to Portal” button.

4) Enter your Apple ID and password when prompted.

5) If there are no errors, you should be able to run the iOS app on the new device.

Advertisements
Tagged , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: