Saturday, May 12, 2012

Deploying Your App to Your Own iPhone / iPad / iPod

When I first learned how to write an iOS application, I found that the biggest challenge wasn't in learning Objective-C, nor was it in becoming familiar with the Xcode IDE.  Instead, the main difficulty was in getting my app on to my own device!  Unfortunately, many of the books and tutorials assume you'll figure this out on your own... and as I learned, the process was not trivial:
  • I had to create a public/private key pair (via "Keychain"),
  • Generate a certificate request (via "Keychain"),
  • Login to the Provisional Portal at the Apple Developer Site,
  • Create and download a development certificate with the certificate request,
  • Find & register the UDID of my device,
  • Create an "App ID",
  • Create and download a provisional profile which links my developer certificate, UDID, and App ID together,
  • Install the certificate & profile into Xcode...
... all for the simple purpose of testing out my app on my iPhone!
Well, thankfully, Apple has reduced this complexity with the release of Xcode 4.  Here are the steps you need to take, in order to deploy your apps to your own device (for the purpose of developing & testing only... Ad Hoc & iTunes App Store distribution is still a much more involved process):
  1. Register as a Paid Apple Developer.  Only paid accounts can deploy to actual devices.
  2. Open up Xcode 4's Organizer, and select "Provisioning Profiles" in the left side menu:
    left-top-menu
  3. On the bottom of the right side, 'check' the checkbox labeled "Automatic Device Provisioning": 
    provisioningprofiles
  4. Plug your device into your computer.  Select your device in the left side menu, and click the "Use for Development" button: 
    setupfordev
  5. You will be prompted to log in to your Apple Developer account.  Enter your credentials here:
    login
  6. Xcode will likely you tell you that it doesn't recognize the version of iOS.  Allow it to collect the necessary information when prompted: 
    unknownios
  7. After this has finished, you're done!  You should now see your device listed in the top left list of "Schemes" in Xcode: 
    xcode
That's it - no more dealing with keys, certificates, UDIDs, App IDs, etc (at least for testing on your own device).  Also, note that you shouldn't need to repeat these steps for the same device on the same computer.  Once your device has been configured, it should be available for all of your Xcode iOS projects!

1 comment:

  1. Very informative post regarding the deploying app to your own iphone... The process is easy to understand... this is the thing which I was searching from few days... Thanks for posting this article.
    event manager apps

    ReplyDelete