This tutorial provides instruction on setting up PhoneGap for your web application on the iPhone.
Requirements
- Macintosh computer with Xcode and the iPhone SDK installed.
- iPhone.
- iPhone developer certification. (only nessacary to install on iPhone)
Step 1
- Open the iPhone project in Xcode (project file now called PhoneGap.xcodeproj)

- Open info.plist and change "BundleIdentifier" to the identifier provided by Apple. You have to run the Assistant at http://developer.apple.com/iphone/manage/overview/index.action and register your App. At no point will it specifically say its created a Bundle Identifier. It will give you an ID ending in .* for your app. This appears to be the Bundle Identifier.

- Go to the menu Project > Edit Project Settings
- Click on the Build tab. Make sure the Configuration menu says "All Configurations" and the Show menu says "All Settings".
- Go down to the Code Signing section on the Build tab. Change 'Code Signing Identity' to your info, then change the sub-item to your info as well (probably says "Any iPhone OS Device").
- Go down to the Packaging section on the Build tab. Change the Product Name to "PhoneGap"
- Change the Prefix Header (under GCC 4.0 - Language) (called 'Executable Prefix' in the packaging section of the build tab) to PhoneGap_Prefix.pch
- Close the Edit Project Settings window and choose Save All when prompted.
- Build and run.

Step 2
- Open 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.

- In PhoneGap.plist, change Offline to 0 and set Callback to the URL you want your application to load.
- Change default.png 320 by 480 pixels. (optional)
Step 3
- Build your web application at the location listed in url.txt

-
-

Comments (23)
DanP said
at 11:59 pm on Dec 26, 2008
This works fine for me in the Simulator, but when I try to debug on the device, I get the following error:
"CodeSign error: Code Signing Identity 'iPhone Developer: Igor Faletski' does not match any code-signing certificate in your keychain. Once added to the keychain, touch a file or clean the project to continue."
I followed the instructions above, and did change the Code Signing Identity and Device submenu. Anyhow know why this would work in the simulator but not on the device? Thanks!
RobKohr said
at 2:55 pm on Jan 5, 2009
Do you need to be certified to use the simulator?
jacobwoods said
at 6:55 pm on Jan 8, 2009
I'm new to iPhone dev, but why do I get a "gap not supported!" javascript error when browsing this page with my iPhone/Blackberry? ( http://www.phonegap.com/demo2/ )
Martijn Pannevis said
at 3:26 am on Jan 9, 2009
Phonegap builds an application that you can install (for the iphone you need a Dev account, which costs $100). It doesn't work in your browser.
jacobwoods said
at 11:32 am on Jan 9, 2009
thanks, so no way to get around creating an app that utilizes the iphone gps without a macbook correct? What about blackberry?
Sunny Day said
at 4:29 pm on Jan 13, 2009
will this run in an mac emulator, the unity engine is for the mac, but, you can use in with an emulator, just wondering if this can also be used as I dont have the money to shell out for a mac to see if this works, also does one need iPhone developer certification, as I would like to test this without it, also is there any simulators for the iphone to see if we get a working end product. Also can we see a screen of a web app that has been converted, Id like to see what one looks like and if it gets rid of the browser bars of the web app.
Raymond Camden said
at 6:54 am on Jan 21, 2009
Where is url.txt located? I no longer see it in the list of settings.
Raymond Camden said
at 9:20 am on Jan 21, 2009
ignore last comment, wiki updated.
Chris said
at 3:30 pm on Apr 5, 2009
I hate to be the ignorant noob but when you say "Open info.plist and change "BundleIdentifier" to the identifier provided by Apple. " could you be more specific? Apple has not provided me w/ any explicit BundleIdentifier string to my knowledge. Also any pointers to a detailed, complete and recently verified checklist for getting the code-signing cert in my keychain in order to build and package and deploy the app, would be very helpful. Thanks! And keep up the great work...
thikonom said
at 5:37 am on Apr 7, 2009
How can i start writing an app on iphone but in windows?Is there a same tutorial but for windows?I ve download the james douma simulator but what else should i do to start?
Helpppp
Jerry said
at 7:35 am on Apr 11, 2009
I followed the directions but I get "Failed to launch simulated application: Unknown error."
When I look at the Errors and Warnings there too many to count. I'm running Simulator - 2.1 |Debug
Also tried with Simulator - 2.0 |Debug - same result
I followed the above instructions although I couldn't find the entry for PreFix Header
davidgo said
at 5:52 pm on Apr 23, 2009
For the above readers - PhoneGap does not save you from the conventional path of iPhone bureaucracy, which you still have to follow to get things working. In short, start by:
1. Visiting http://developer.apple.com/iphone
2. Creating a developer account (this part is free)
3. Downloading the iPhone SDK
Now you can open the project in xcode and test using the iPhone Simulator.
Additionally, if you want to install your app on an iphone, you will need to:
4. Purchase an iPhone Developer Program certificate (this costs you $99 and can take weeks or months for approval)
5. Create an application in the Developer Program Portal, and follow the instructions there. You'll get the BundleID from Apple if you follow those steps closely.
This process is a royal pain, but it's liberally documented elsewhere. Good luck!
bitnaut said
at 9:48 am on Apr 29, 2009
I managed to finally get this to compile (for some reason Glass.app was still referenced in the project even though no one was building it) under the 3.0 SDK beta 4 but it just crashes randomly when I run it. How have people actually made running apps with this thing? It seems so buggy.
anywherestudio said
at 11:31 am on Apr 29, 2009
I don't think it's set up to work with 3.0 yet, they're probably (wisely) waiting for the final release before they update.
Jay said
at 11:03 pm on May 3, 2009
When I load it on the iPhone, the app displays the Default.png image, shows the buttons for a second, and then crashes... any thoughts on why that might be the case? 1st gen iPhone. Also, is callback url necessary? The wiki post says it's in url.txt but appears to be in PhoneGap.plist
Ralf Rottmann said
at 9:26 am on May 13, 2009
Downloaded the latest package (as of May 13th 2009) via Git. Fresh clean install. "Glass.app" is still referenced and could not get this working. Neither by cleaning the entire project nor by any possible setting. Getting started failed, for me. Any help?
Josiah said
at 11:20 am on May 13, 2009
@Ralf Rottmann:
Check this thread about your Glass issue:
http://groups.google.com/group/phonegap/browse_thread/thread/bf1e2e3b0ded453c/ce2f2bf8cd2064b6?lnk=gst&q=latest+glass#ce2f2bf8cd2064b6
Ralf Rottmann said
at 11:35 am on May 13, 2009
Thanks for your comment. Did not solve the issue, though. I meanwhile found a solution myself and posted it for everybody else here:
http://www.24100.net/2009/05/phonegap-and-iphone-sdk-30-no-launchable-executable-present-at-path/
You can contact me via Twitter: http://twitter.com/ralfrottmann
Hope this helps. Keep up the good work!
SteveT said
at 9:50 am on May 16, 2009
I'm new to macs and xcode development. Do I need to make a copy of the iPhone project for every app I'm going to write? Maybe I missed it elsewhere on this site but is there also a list of files under the project directory that I don't need and can remove? Is it necessary to follow the instructions elsewhere to rename the project so it doesn't have any references to phonegap before submitting my app for approval? Any help would be welcome.
Mihai Radulescu said
at 3:00 am on May 29, 2009
I just try to connect to the gid repository using "git clone git://github.com/sintaxi/phonegap.git" and I get a :
Initialized empty Git repository in /labo/playground/phonegap/phonegap/.git/
github.com[0: 65.74.177.129]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
Mihai Radulescu said
at 3:04 am on May 29, 2009
More I try to download a tar (and a zip) and I try to search the gap.js file but there is no such file. I need this because I want to do the "Building your first mobile application with GeoLocation".
Do I miss something here ?
Charles Lawrence said
at 8:28 pm on Jun 1, 2009
The documentation on this page needs to be fleshed out ALOT. It might seem like old-hat to people who have been doing this for a while, but for someone completely new to trying to set this up, this is missing a lot of pieces. The first case in point is about the Bundle Identifier. 1) Its *not* well documented elsewhere. If I search on "iphone bundle identifier" and don't find any how-to information in the first 6 pages of Google, its not well documented. 2) I ended up going through the assistant on http://developer.apple.com/iphone/manage/overview/index.action and at no point does it tell you "Here's your Bundle Identifier". It generates a random code that looks nothing like com.domain.appname. After hunting and pecking around for 20 minutes, someone said this code is the bundle identifier.
Vineel Shah said
at 7:30 pm on Jun 2, 2009
I found my bundle identifier by opening my ".mobileprovision" file in a text editor and found the value in the "application-identifier" part of the xml. It looked like this:
<key>Entitlements</key>
<dict>
<key>application-identifier</key>
<string>3LL12K7IKZ.*</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>3LL12K7IKZ.*</string>
</array>
</dict>
( I changed my idenfier of course, but that's what it looked like." )
My ".mobileprovision" file was created as part of the "provisioning" process that tied my iPhone to my App and my developer account from Apple. I did this on a Macbook Pro running 10.5.7.
You don't have permission to comment on this page.