Xcode 4: Deploying Your App to Your Own iPhone / iPad / iPod touch

   Posted by: Jason Shapiro

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!


Comments (2)

mike leonard 10/7/2011 3:05 PM

Thanks for the info. As soon as I figure out how to develop an APP, I will use the info you provided.

Paul Rez 10/18/2011 4:49 AM

Hi Jason,

thank you for clearly explaining this. My phone now comes up in the device list but when I try to run the code I get:


[BEROR]Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain


I'm a total noob, any idea what's wrong here?

thanks!
Paul

Add a Comment

*

*

Loading

Find Us
Contact Us 651-288-7000 1-800-866-9884
Home | Training | Curriculum | Course Finder | Schedule | Enroll | Twin Cities Java User Group | Consulting | Foundation | Jobs | About Us | Our Story | Press Room | Instructors | President | Map & Directions | Sitemap

Java Training | JSF / Struts / Spring / Hibernate Training | Java Power Tools Training | .NET 4.0 & Visual Studio 2010 Training | Microsoft Web Development Training | Prism / MVVM / MEF Training | .NET 3.5 and Visual Studio 2008 Training | .NET 2.0 and Visual Studio 2003 Training | Cloud Computing Training | Ajax / Web Services / XML Training | Groovy and Grails Training | SQL Server 2012 Training | SQL Server 2008 Training | SQL Server 2005 Training | Mobile Development Training | SharePoint 2010 Training | SharePoint 2007 Training | Agile, Process, Analysis & Design Training | Arch/Design Patterns Training | Microsoft Official Curriculum Training | Web Development Training | Ruby Training | Rational Application Developer (RAD) Training | WebSphere Application Server Training | WebSphere Portal Training | WebLogic Training | Boot Camp Training | Project Management Training | C / C++ Training | Metro / WinRT / Windows 8 Development Training | Retired

Intertech delivers training on-site and virtually serving cities including Phoenix, AZ | San Francisco, CA | Los Angeles, CA | San Diego, CA | San Jose, CA | Washington, DC | Chicago, IL | Orlando, FL | Boston, MA | Duluth, MN | Minneapolis St. Paul, MN | Rochester, MN | Raleigh-Durham, NC | New York, NY | Philadelphia, PA | Austin, TX | Dallas, TX | Houston, TX | Seattle, WA.