- Dec 13, 2011
Setting Up Your Device
Now that your development machine is set up, it’s time to set up your iPad for development. Here’s what needs to happen:
- You need to register your device ID.
- You need to create an App ID.
- You need to create a development provisioning profile.
- You need to download and install the development provisioning profile.
These steps can be performed in one of two ways: by using the Xcode Organizer window or the iOS Provisioning Portal. Using Organizer is by far the easier way to set up your iPad for development. It performs the steps automatically for you. This approach is, however, not without its limits.
Organizer creates a wildcard App ID, and as you may recall, a wildcard App ID cannot be used if you plan to use Apple services like Game Center, In App Purchase, and Push Notification. That said, you should still let Xcode do its magic. While you may not use a wildcard App ID for your next awesome iPad app, it can be used to build and run sample apps and to test proofs of concept and prototype applications on your iPad.
Use for Development
The steps to set up your iPad for development are quite easy using Xcode. Tether your iPad to your development computer. Launch Xcode and open the Organizer window (Windows > Organizer or Shift- -2). Organizer shows the list of registered and attached iOS devices. Attached devices have a status icon displayed to the right of the device name. A white status icon means the device is not ready for development. A green status icon means the device is ready for development. A yellow status icon means the device is busy.
Click the name of your iPad in the Devices list. You should see a screen similar to the one shown in Figure 6.9. Click the Use for Development button. Xcode will prompt you for your iOS Provisioning Portal credentials. Enter your Apple ID and password used for your iOS Developer account.
Figure 6.9. Organizer window with a new Apple device attached to the computer
Xcode automatically sets up your device for development. It registers your device with the iOS Provisioning Portal, creates a wildcard App ID and development provisioning profile, if needed, and last downloads and installs the provisioning profile.
The process can take a few minutes. While the process is running, the status icon is yellow. Do not disconnect your iPad from your computer while the process is running. Once the process is compete, the status icon changes to green and you will see a screen similar to the one in Figure 6.10.
Figure 6.10. Organizer window with an attached Apple device ready for development
You are now ready to build and run iOS applications on your iPad. To test that everything has been set up correctly, create a new project in Xcode. You can select any iOS application template; it does not matter which one. Make sure you select your iPad as the device for the active scheme (seen in Figure 6.11). Build and run (-R) the project. Assuming your development machine and iPad are set up correctly, you will see the sample app running on your iPad.
Figure 6.11. Use the scheme popup menu to set the run destination.
As you just learned, using Xcode is the easiest way to set up a new device. But what happens if there is a problem? And what if you plan to use Apple services like iCloud, Game Center, or In App Purchase, which require an explicit App ID? You need to use the iOS Provisioning Portal to manually perform the steps.