Saturday, February 28, 2009

Deploying to the iPhone

It's taken me more than two weeks to get my app on to the iPhone. Most of the delay was bureaucratic, caused by a mix up in my account profile (mixing a New Zealand contact phone number with the US billing address for my card -- ack!). Resolving things took several weeks, faxing notarized copies of passport pages, several phone calls etc.

When I tried to provision my device and build I started getting the error "a valid provisioning profile is required". Various gurus have pages describing the steps you have to take to hack the underlying project files (analogous to manually editing a project file for Visual Studio) to resolve this error. In the end, I just manually deleted the .mobileprovision file that I had downloaded and replaced it, deleted the provisioning information and recreated it.

You have to Provision the device (Window/Organizer, select your device, point it at the .mobileprovision file). Leave the "Applications" section blank for now. (I was confused -- the only compiled app I could navigate to was the x86 version for use in the simulator).

There are many step-by-step guides online. The one gotcha that I would draw your attention to is that you have to specify your code signing identity in two places -- in the Project preferences and by navigating in the left pane of XCode to the Targets section. (Click your application, then control-click and select "Get Info" from the context menu.

Then it's a matter "Build and Go".

Yay, my teach-myself-iPhone-programming app works on the device.

No comments:

Post a Comment