Most Comprehensive "New Media" Coverage of Apple iPad

iPad on Ulitzer

Subscribe to iPad on Ulitzer: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get iPad on Ulitzer: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

ipad Authors: Kevin Benedict, Newswire, Shelly Palmer, RealWire News Distribution

Related Topics: iPhone Developer, Macintosh Magazine, Location Based Services, iPad on Ulitzer, iPad For Business, Apple Life Magazine

Blog Feed Post

Xcode 3.2.3 or: How I Learned to Love Automatic Provisioning

No Manual, Tedious, Laborious Processes

So I'll start this off with a horror story. It involves me, awake at 4am sitting huddled in front of my Macbook Pro. It's got an iPod touch dangling from a USB connection and the wrist rest area on the laptop looks a little dented. I'd been working on some code all day and I was trying to debug that code on my device. See, I'd started writing the code on a different laptop and had debugged the last build of the app on a different iPod touch. Those of you who have experienced deploying apps to test devices on teams know where I'm going with this. The act of creating provisioning profiles that are tightly coupled to individual developer's non-portable, machine-specific private keys (yes, I know you can export them, but it involves making a deal with a demon at a crossroads) was a hideous, painful process. Every time anyone suggested that I move code from one machine to another or try and debug code on a different device, I would cringe in horror. As great as the iPhone OS SDK was, once your app compiled - the act of getting that thing onto a device for development, testing, and distribution was an absolute, unfiltered pain in the ass. The first time I heard someone say, "Send me your private key, I need to test the code" I'm pretty sure my eyeballs exploded.

Enter Xcode 3.2.3 - the version of Xcode you get with the iOS 4 SDK. Fear not people - none of this is NDA (I checked). With the newest version of Xcode, all of the manual, tedious, laborious process of going to the developer website, creating provisioning profiles and keys, downloading the profiles, installing them via organizer, praying everything worked, and then doing this over again every time you moved your code... is GONE.

If you don't believe me, try the following steps and then rejoice in the fun that has returned to iPhone development:

  1. Fire up Xcode. Open the Organizer window.
  2. Create a new project. I called mine 'AutoProvision' because I simply did not have enough caffeine in my system to be creative. I created a tab bar project but you can create anything - just make sure it matches the type of device you are going to plug in (e.g. don't create an iPad project if you're plugging in an iPhone.. duh)
  3. Plug in an iPod touch or an iPhone. If organizer asks you if you want to use it for development, say yes. If organizer doesn't, then right-click it in the left navigation panel and choose the "add to provisioning portal" option. Oh yeah, that's right people - it IS that simple.
  4. After a bit of magic happens, Xcode will have communicated with the provisioning portal on your behalf, created some keys, reticulated some splines (bonus points for the game reference), and set up a new provisioning profile that will work on ANY developer's machine. Xcode will probably ask you for your iPhone developer username and password. If you are a part of multiple teams, it will ask you to choose the team for which you're using the test device.
  5. Make sure Xcode's current build is set to the "Device" not "Simulator"
  6. Hit Debug.
  7. Rejoice and listen to the angels sing.

At this point you're probably thinking, "Oh no he didn't!" or, "This guy is crazy... installing on a device is WAY harder than that!". Well, that's why Xcode 3.2.3 has been chosen to bear my next child. All of the headaches of yore are gone. Xcode now works like it should have since the beginning - you can create a new project, plug in a device, and hit "Debug" and go to town with no speedbumps, no frustration, nothing.

Another new feature of Xcode 3.2.3 is the concept of an "Archived" application. You can use these archived applications to test your application the same way Apple would test your app during the approval process for the AppStore. If the tested archive passes, you can even push a button right inside organizer to upload the app to the app store. Those of you who have run through the bloody gauntlet known as the appstore submission process know how HUGE this is. I will be talking about app archives later.

For now, open up an Xcode project and rejoice in the fact that you can now deploy to a device without stabbing yourself in the eye. This is just one tiny piece of awesome that comes with Xcode 3.2.3, that's not even covering the greatness inside the iOS 4.0 SDK!

Read the original blog entry...

More Stories By Kevin Hoffman

Kevin Hoffman, editor-in-chief of SYS-CON's iPhone Developer's Journal, has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise web applications in VB, C++, Delphi, and C. Hoffman is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. He authors The .NET Addict's Blog at .NET Developer's Journal.