I had to set up PhoneGap on Xcode 4 yesterday and found many confusing, wrong, or just outdated pages describing how to do it. I think they fixed some things in PhoneGap 1.0.0, so the install is much simpler than what these pages were saying. So here is my version which worked for me:
- Download and install PhoneGap 1.0.0 on your mac. Get it here. This downloads a ZIP file. Open it up and run the DMG file installation in the iOS directory. The instructions I saw said to have Xcode closed at this point, which I did.
- Open Xcode and create your new PhoneGap project. This will set up everything except the www directory.
- In Finder, navigate to your project (mine is in my home directory under ‘Xcode projects’). Copy the www directory from <Macintosh HD>/Users/Shared/PhoneGap/Frameworks/PhoneGap.framework/ and paste it into your project in the same directory as the *.xcodeproj file (i.e., your project’s root directory)
- In Xcode, right click on the top-most project header (the blue-ish project header block that contains the entire project) and select “Add Files to <your project name>”. Find and select the www directory that you just placed in your project, and make sure to change the “Folders” radio button to “Create folder references for any added folders”. Press Add. Your project should look like this: