iPhone App development step 2: Keychain

So I paid my $99 and got approved by Apple. Many months passed during which I never had a free weekend. This week, my roommate and I decided we’d get up 2 hours early every day and work on a personal project during those two hours, so for the last hour and a half I’ve finally done some iPhone development. Well, setup for it.

During the last few months, I’ve been asking some other iPhone developers I know how to get started, and gotten some tips; a couple different ideas for how to test-drive an app, ways to get started, and such. None of them mattered this morning; I ended the morning being blocked by something completely unforeseen.

I already downloaded and installed the 2.2.1 SDK, not really knowing what that means. I guess it’s a text editor, build system, and standard library for the iPhone. I found xCode, the editor, on my computer, and walked through apple’s Hello World iPhone tutorial. It involved the creation of a project and the retyping of some code without understanding it (the language is objective C), then a build and a run. The build failed with this message:

CodeSign error: Code Signing Identity ‘iPhone Developer’ does not match any code-signing certificate in your keychain. Once added to the keychain, touch a file or clean the project to continue.

Sounded like Apple’s SDK won’t even build your project for you locally unless it has some authentication. I didn’t know what keychain was, but it sounds like Pageant. I googled this error and saw lots of forums threads I didn’t understand, then looked around apple’s website. It said that I needed an “iPhone Development Certificate,” which I wrongly assumed I already had. It turns out that what I have is membership in the iPhone Developer Program, which is different. What that gets me, according to apple, is the ability to apply for an “iPhone Development Certificate”, which is what the SDK requires. To apply for an iPhone Development Certificate, I needed to create a Certificate (some kind of crypto key, created by an apple program called Keychain) and submit it in a Certificate Request.

The instructions for creating a Certificate were only hinted at, not explained, in the developer section of the apple website. They said I needed to go to the “iPhone Developer Program Portal” to actually get instructions and submit the certificate request. When I tried to log into the portal, it walked me through the developer signup steps (including the $99 payment, again) – turns out this was a bad cookie horking my session. At the end of the signup, the developer webpage told me I’m already a developer, and wanted me to sign out. I signed out and back in, and lo, I had a link to the “iPhone Developer Program Portal”!

In it were wrong instructions for how to create a Certificate Request. In particular, they assumed the wrong location for the program (KeyChain) that creates the security keys, one of which I need to submit. (Also, I learned that OS version numbers have magic names. “Leopard” is the one Apple expects me to have. I don’t know what jungle cat my mac mini is actually running.) At Dusty’s suggestion, I used the finder to launch KeyChain, and from there the walk-through worked fine. I created a key and submitted it with a Certificate Request. At that point, I was blocked until Apple approved the request, so I dropped development for the day and started writing this blog entry.

About halfway through typing this up, Apple approved my Certificate Request, so I can get started again. Unfortunately, my 2 hours for today are almost up, so I’ll have to pick up here tomorrow morning. See you then!

Advertisements

3 Responses to iPhone App development step 2: Keychain

  1. […] 2 part 2: I suck at setup I went back to the project portal I had so much trouble finding yesterday, and resumed the walkthrough for getting my security key / certificate set up. The instructions […]

  2. Justin says:

    Sounds like a pain! I’m grateful you wrote this blog so now I know what to expect… I had no idea that, in addition to $99, I had to go through some certificate process…so many barriers to entry into the world of iPhone development. Wow! No wonder companies are having a tough time finding solid iPhone App developers…

  3. Yeah, I recently started iPhone development, and my officemate had to walk me through all the steps… and there are a looooot.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: