ie8 fix
madison

Getting started with iPhone development

By | November 13, 2008, 7:24am PST

Summary: I’ve been doing Android development for some time, and before that I experimented with Palm and Blackberry, so I figured it was time for some hands-on iPhone programming as well. In this article I’d like to share a few of my initial experiences. Apple released the first official iPhone native SDK in March 2008, although there [...]

I’ve been doing Android development for some time, and before that I experimented with Palm and Blackberry, so I figured it was time for some hands-on iPhone programming as well. In this article I’d like to share a few of my initial experiences.

Apple released the first official iPhone native SDK in March 2008, although there were ways to run native programs unofficially before that. In an earlier article, Apple opens iPhone to developers, I introduced some of the basics of the architecture and tools so you may want to read that first.

Prerequisites

The first thing you need is an iPhone or iPod Touch of course. You can do some early development using the simulator, but there’s no substitute for the real thing. Next, you need an Intel-based Apple Mac running OS X version 10.4 or higher.  I recommend at least 2GB of memory and a decent monitor (24-inch works well).

You’ll have to sign up for 2 things on the Apple web site:

  1. Become a “Registered iPhone Developer”. This is free and it gives you access to download the iPhone development tools including the emulator.
  2. Join the “iPhone Developer Program”. This currently costs $99 for individuals or $299 for companies. The big thing this gives you is the cryptographic keys so you can download your code to a real phone.

Finally, you download and install the iPhone software development kit (SDK). It’s pretty big, so don’t be surprised if it takes a while to load.

Could they make this any harder?

Once you get all of the above in place you load up a sample program into Xcode, plug in your iPhone, and click Build and Go and everything works. The end.

What? That doesn’t work? Oh, ok, there are a few other itsy-bitsy things to take care of first. Compared to this, getting started with other platforms is a walk in the park.Actually there are several large and annoying things, mostly centered around those cryptographic keys. If you do it wrong, you’ll see an error like this when you run your app:

Your mobile device has encountered an unexpected error (0xE8000001) during the install phase: Verifying application

Thankfully there is a wealth of information on the web to help you past this hurdle, both in Apple’s iPhone Reference Library, and in blogs like this excellent article by Ralf Rottmann. You’ll need it.

The key (no pun intended) is that you need to download and install at least 3 different cryptographic certificates:

  1. An Apple world-wide developer certificate (WWDR), installed on your Mac,
  2. A personal  developer certificate, also installed on your Mac, and
  3. A mobile provisioning profile, which will be installed on your iPhone. Actually you may need 3 of these, one for local development, one for betas, and one for the AppStore.

Ralf goes through all the steps, including lots of screenshots, so I won’t repeat that here. But I did have one problem that Ralf didn’t have. After following all the instructions, programs *still* were not installing. A colleague suggested wiping and re-installing the iPhone but I really didn’t want to do that. It turns out I had to delete my provisioning profile and re-install that.

From Xcode, go to Window > Organizer, select the iPhone, select the Summary page, and then select the profile in the Provisioning area. Click on the “-” button to delete it. Then click on “+” and add it back again (you’ll have to navigate to the .mobileprovision file you downloaded from the Apple web site). If you switch over to the Console tab and click Reload you’ll see a message like “downloaded 44484 bytes of firmware data (0×0088.hex”) in 69ms” - that’s the Mac installing the profile onto your phone. From then on, everything was honky-dory.

Success

Now you should be able to build your sample and run it on the phone. I chose the GLGravity sample, which you can find here if you can get logged in. Just unpack it somewhere and double-click on the .xcode file. It draws a teapot on the screen using OpenGL, then uses the accelerometer to keep the bottom of the teapot pointed towards the ground no matter how you hold the phone.

I have to say that the barrier for getting started with iPhone development was higher than I expected. The Apple Developer Connection site is frustrating, confusing, and on top of that it keeps logging me out every few minutes. Everything is locked down tighter than a drum, and juggling multiple cryptographic keys just complicates everything. Compared to this, getting started with other mobile platforms is a walk in the park. Hopefully it will get easier from this point on.

Kick off your day with ZDNet's daily e-mail newsletter. It's the freshest tech news and opinion, served hot. Get it.

Topics

Ed Burnette is a software industry veteran with more than 25 years of experience as a programmer, author, and speaker. He has written numerous technical articles and books, most recently "Hello, Android: Introducing Google's Mobile Development Platform" from the Pragmatic Programmers.

Disclosure

Ed Burnette

Ed Burnette is a Manager of Mobile Development at SAS. However the postings on this site are his own and do not represent the positions, strategies, or opinions of his employer.

Biography

Ed Burnette

Ed Burnette has been hooked on computers ever since he laid eyes on a TRS-80 in the local Radio Shack. Since graduating from NC State University he has programmed everything from serial device drivers and debuggers to web servers. After a delightful break working on commercial video games, Ed reluctantly returned to business software. He currently develops enterprise software for Android phones and tablets.

In his copious spare time, Ed writes and speaks about all kinds of technology and software. His most recent books include the Eclipse IDE Pocket Guide from O'Reilly and Hello, Android: Introducing Google's Mobile Development Platform from the Pragmatic Programmers.

Related Discussions on TechRepublic

Did you know you can take part in these discussions with your ZDNet membership?
5
Comments

Join the conversation!

Just In

RE: Getting started with iPhone development
avlnet@... 19th Nov 2008
It's been more than a week, that I have submitted my request to both ?Registered iPhone Developer? and the ?iPhone Developer Program". I was able to download the SDK and my credit card was charged for the program, but still not able to access the Developer Portal to get the certificates.

I had sent a couple of emails to Apple support, but no response at all.

Any idea how long do I have to wait and if it's been already too long, any suggestions?

Thanks.
-AVL
0 Votes
+ -
Pretty Negative Spin there Ed
CowLauncher 13th Nov 2008
For pretty basic stuff a programmer should be able to figure
out.
0 Votes
+ -
Contributr
Re: Negative spin?
Ed Burnette 13th Nov 2008
I figured it out but it just took longer than I expected based on my experience with other mobile platforms. Locking everything down so hard (Mac only, 2 levels of registration, 3-5 certificates/profiles) made the out-of-the-box developer experience more frustrating than it could have been.
Not counting the download and getting approved, it all goes
very fast.
0 Votes
+ -
Thanks Ed for linking to my blog post. I've received so
much feedback over the last months. The certificate
integration into Xcode seems to worry many programers
out there.

I'll add your findings to my blog post.

Let's stay in touch.

-Ralf
(www.24100.net)
0 Votes
+ -
It's been more than a week, that I have submitted my request to both ?Registered iPhone Developer? and the ?iPhone Developer Program". I was able to download the SDK and my credit card was charged for the program, but still not able to access the Developer Portal to get the certificates.

I had sent a couple of emails to Apple support, but no response at all.

Any idea how long do I have to wait and if it's been already too long, any suggestions?

Thanks.
-AVL

Join the conversation!

Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]
ie8 fix
Click Here
ie8 fix

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

White Papers, Webcasts, & Resources
ie8 fix
ie8 fix