iPhone Game Development - Chris Craft [12]
iPhone Developer Program Portal
App submission
iTunes Connect support
Tech support
University program
Bug reporting
Testing Applications on Your Device
One of the biggest benefits of being in the iPhone Developer Program is the ability to test your creations on physical devices. If you are like us, this is also one of the first things that you'll want to try to do. Unfortunately, it's not as easy as just plugging the device into your Mac and clicking Run. If you could do this, you could potentially install your application on any device that you plug into the Mac—and that is exactly what Apple does not want you to do. If this were possible it would be easy to circumvent the App Store entirely. Apple has put a series of checks and balances in place to ensure that only developers can install software on their registered devices easily. The following steps illustrate what you need to do to install an application on your iPhone or iPod touch (Figure 1.9):
FIGURE 1.9
Installing and testing your applications on your iPhone and iPod touch
1. Generate and install a Development Certificate.
2. Register iPhone and iPod touch Device IDs.
3. Create an App ID to identify your application.
4. Generate and install a Development Provisioning Profile.
5. Configure the Code Signing Identity of your application.
6. Build and test your application on your development device.
Let's look at each of these steps in more detail.
Generate and install a Development Certificate
Certificates are electronic documents that associate your digital identity with your iPhone Developer Program account. iPhone Development Certificates can only be used for application development and are set to expire after a limited amount of time. Apple can also revoke your Development Certificate before it expires. In short, you need the certificate to deploy and test applications on your device, but Apple has ensured that it can prevent developers from abusing this privilege.
There are two steps to generating the certificate. First, you have to use the keychain tool on your Mac to create a certificate request. Next, you upload your certificate request in the iPhone Developer Program Portal, where the certificate is generated. Once this is done you can download and install the certificate.
To generate a certificate request, follow these steps:
1. On your Mac, launch the application Keychain Access.
2. From the application menu, choose Keychain Access⇒Preferences. From here, set Online Certificate Status Protocol (OSCP) and Certificate Revocation List (CRL) to Off.
3. Choose Keychain Access⇒Certificate Assistant⇒Request a Certificate From a Certificate Authority (Figure 1.10).
Figure 1.10
Using Keychain Access to request a certificate from a certificate authority to begin the process of generating your certificate
Caution
Make sure you are choosing Request a Certificate From a Certificate Authority and not Request a Certificate From a Certificate Authority with 4. Enter your e-mail address in the User Email Address field. Be sure that the e-mail address you enter here matches the e-mail address that you used when you registered as an iPhone Developer. 5. Enter a name in the Common Name field. Likewise, the name you enter here should match the name you used when you registered as an iPhone Developer. 6. Leave the CA (Certificate Authority) Email Address field blank. 7. Click the Saved to disk radio button and click in the Let me specify key pair information check box (Figure 1.11). Click Continue. 8. In the popup menu, specify a filename and click Save. For the Key Pair Information settings, choose 2048 bits for the Key Size and RSA for the Algorithm (Figure 1.12). Click Continue. 9. The Certificate Assistant creates your CSR file. By default the CSR will be saved to your desktop with the name