1. In preparing our application and device for testing, we're going to build what is called a Provisioning Profile. This file is required for applications that we want to test on a device and will include information from our Development Certificate, Device UDID, and App ID. The Provisioning Profile works with XCode, iTunes, and our device to make sure that we're running an authentic copy of our app.
First, acquire the iOS Development Certificate by generating a Certificate Signing Request with Keychain Access. This process will give your applications the appropriate private key required for an iOS device to run our application.
Launch Keychain Access from our Applications folder in OS X. Next, visit the Preferences window, which can be found in the Keychain Access menu bar or by using the Command + comma keyboard shortcut. Navigate over to the Certificates tab, and then turn Online Certificate Status Protocol and Certificate Revocation List modes off before closing the Preferences window.
2. Next, go back to the menu bar and select Request a Certificate from a Certificate Authority under the Certificate Assistant menu item.
3. When filling out the Certificate Assistant form, be sure to use the email address that is associated with our iOS Team Agent Apple account.
4. Fill out the Common Name field, leave CA Email Address blank, click on the Saved to Disk radio button, select Let Me Specify Key Pair, and then click on Continue to proceed.
5. Select 2048 bits key size and RSA algorithm options when prompted on the next screen. After clicking on Continue, a CSR file will be created on our computer's desktop.
6. Now log into the iOS Provisioning Portal using our Team Agent account. Click upon the Certificates navigation option, then click on Request Certificate under the Development tab.
7. Scroll down the page, click on Choose File, then select the CSR file from our desktop.
8. After successfully submitting the file, an email should be sent to the Team Admin and the status of our uploaded certificate will change to Pending Approval. The Team Agent account user can then approve the certificate request and a new certificate will be available for download in the Certificates menu in the iOS Provisioning Portal.
9. Once downloaded, double click the new .cer
file and install the certificate using Keychain Access. This new certificate will last for a year before it expires, after which we'll have to go through this whole process again.
10. With our new certificate loaded onto our computer through Keychain Access, we're now ready to configure our test device through XCode. We should now tether our iOS device to our computer through the standard 30-pin connecter and launch iTunes.
Once the device finishes the sync process, select the device under the Devices menu and click on the Summary tab. Now we'll want to use our mouse to click on the device serial number that is located near the top of the window. This will reveal our device's UDID, which we can select by using the Command+C copy shortcut.
Then we head back to our web browser and the iOS Provisioning Portal, where we can select the Devices menu option. Click the Add Devices button, enter a device name, and then paste in the device UDID using the Command+V paste shortcut. Click on Submit and our device has now been configured as a test device.
11. We now need to create an App ID, which is a unique identifier that Apple uses as part of the Provisioning Profile. App IDs help make special iOS features like in App Purchase, Push Notification, or Game Center work.
Using our Team Agent account, log into the iOS Provisioning Portal and navigate to the App ID menu section. Click the New App ID button and give a short description for our App ID. For the Bundle Seed ID drop down option, either generate a new Bundle Seed ID or use a previous ID. We would use a previously generated ID if we wanted our application to share data with an existing application.
Now we should enter a Bundle Identifier into the text field. This identifier should match the CF Bundle Identifier that has been set for the app under the Application Settings in XCode. If we ever plan on using features like in App Purchase or Push Notifications in our app, we should use a unique Bundle Identifier. Apple suggests the com.companyname.appname
format, to guarantee that our Bundle Identifier is unique across all IDs. For example, a company called ABC Software with an application called Our Great App would create a Bundle Identifier called com.abcsoftware.ourgreatapp
.
12. Since we've now created our development certificate, registered our test device, and created an App ID, we can move forward and create the actual Provisioning Profile for our application. Using this new profile, we can successfully send a test application to a device and finally try out our application.
Using our Team Agent account, visit the Provisioning menu section of the iOS Provisiong Portal. Click on the Add button and give a name to our new Provisioning Profile. We should then click the check buttons for each device that we want to test our application on. Finally, we should select the Developer Certificate and unique App ID that we want to use for our application.
After entering in all of this information, click on the Submit button and a new Provisioning Profile will be created which we can use to test our application. While still in the Provisioning section of the iOS Provisioning Portal, we can download our new profile and save it to our computer.
13. Once the Provisioning File has finished downloading, drag the file from Finder to XCode or iTunes to install the profile. We should now launch XCode and open the Organizer under the Window menu bar option. As long as our iOS device is still connected, we should see it here in the side menu. Under the provisioning option in the window, click the plus button and locate the Provisioning Profile if it isn't already selected.
14. At this point, we've successfully created a provisioning profile for our test application. Now head to our project file in XCode, select the project from the Target option in the side bar, then hit the blue Info button up on the toolbar. Scroll down and set the Code Signing Identity field to developer certificate associated with our new Provisioning Profile. We can now close the Info window.