Before you can install the app you create with PhoneGap on your device, you need to sign up as a Developer with Apple and go through the business documentation, Certificate Signing, and Developer Certificate process, all of which are detailed on Apple’s web site (https://developer.apple.com/programs/ios/), under Prepare for App Submission. Nevertheless, you can skip all those steps and still see your work in the the iOS Simulator included with Xcode — you just won’t be able to view the app in your device or App Store. Xcode is a free download you can download now, but the Developer status comes at $99 a year.
If you are new to creating apps for the App Store, you’ll want to peruse the App Store Review Guidelines to make sure your app meets the rules (requires sign-in): https://developer.apple.com/appstore/guidelines.html You are strongly encouraged to make use of these documents before you start your project, lest you run afoul of Apple’s rules for what apps they will and will not allow in the App Store.
You’ll need Mac® OS X® Lion or greater (10.7.4+ available for purchase from the Mac App Store) running Xcode 4.5+ (free download from the Mac App Store) with the iOS 6 SDK (software development kit). Although you can develop the HTML/CSS/JS portion of an iPhone app on a Windows machine, you’ll still need a Mac with Xcode to convert the code to the binary that is uploaded to the App Store. You need a Mac to make iPhone apps.
Cordova uses the command line to create new app projects, so you’ll need to download that after installing Xcode. In Xcode, go to Xcode > Preferences > Downloads > Command Line Tools.
To test on a device, the device needs to have a minimum of iOS 5 installed.
Downloading Apache-Cordova PhoneGap
The 31MB download went to my Downloads directory. Double-clicking n the file gave me a directory folder called “phonegap-2.6.0rc1”
In phonegap-2.6.0rc1, I clicked on the “ios” directory. Developers should read the RELEASENOTES.md provided to see if there are any changes they may need to make to update their code.
The README.md file tells us where the Getting Started guides are located online, various PhoneGap-related websites developers should know about, and briefly explains the directory structure in the PhoneGap directory. Do read it.
The phonegap-2.6.0rc1/doc directory gives us a wealth of material, including the API references and Getting Started guides. The instructions for this article on installing PG 2.6.0rc1 were taken from doc > index.html > Getting Started Guides > Getting Started with iOS. They were not yet available online when I downloaded this.
iOS Plugin authors/users should also read: https://github.com/apache/cordova-ios/blob/master/guides/Cordova%20Plugin%20Upgrade%20Guide.md
Creating a New Project
1. We’ll be using the Terminal app to enter a line of text that sends the command to create the basic files used in a PhoneGap app. The command line text is composed of information in the following order with a space between each piece:
The command (./create)
The location of the directory to be created (such as /Users/Steve/Documents/PhoneGap_apps/PhoneGap_apps/testPG260/)
The Xcode package name (such as com.stevehusting.TestingPG260)
And the project’s name (TestingPG260)
2. Now let’s execute the actual command. Open the Terminal app, either from the dock or by typing “terminal” in the search box that appears when you click on the magnifying glass in the upper right corner of the desktop.
3. Hold down the Command key while you drag the phonegap-2.6.0rc1 > bin directory to the Terminal window. This sets that directory in the command prompt as the starting point for finding the ./create command.
4. Copy/paste all the pieces of the command line as noted earlier, in order, with a space between each:
./create /Users/Steve/Documents/PhoneGap_apps/PhoneGap_apps/TestingPG260/ com.stevehusting.TestingPG260 TestingPG260
5. Give the command time to work, then check the location for the directory and open it. If found, exit the Terminal. There are a variety of errors you can get if any of above four steps have been compromised, such as not starting the command prompt at the /bin directory as stated in step 3.
If you check the Getting Started with iOS guide included in this download, you’ll find additional parameters, such as referencing the common Cordova library from a fixed location.
If you’ve built up a few of the earlier PG projecs, you’ll see that the install follows the exact same steps back to 2.3.0.
Setting up the Project in Xcode
At this point, since the project follows the same building process as earlier PG version downloads, just visit https://iphonedevlog.wordpress.com/2013/01/21/phonegap-2-3-0-in-mac-os-x-mountain-lion-10-8-from-download-to-ios-app-store/ to read about how to set up your project for published on the App Store. In that article, you’ll substitute “TestingPG230” for “TestingPG260,” of course. Start with the heading, “View Files in the Simulator.”
If you are only releasing an app in English, using no localizations (which allows users to read your app in their language), then you’ll want to delete the localization sections from your app folder structure within Xcode. If you don’t, the app will not go through until you add at least one screenshot per language. The Developer Console will accept the binary uploaded, but will leave a note asking for a localized screenshot. (For more about localizations, one article is: https://code.google.com/p/jquery-i18n-properties/)
You can safely delete these directories (right-click, Delete, Remove Reference) if not using localization:Resources/de.lproj
Also, read the 2.6.0rc1 Getting Started further if you have problems. Some problems and their solutions are covered there that are not in my article.