Getting Started with iPhone Programming: Ten Steps
I thought I’d put a few notes together on my experiences so far too. These are the ten steps to get started with iPhone programming. There are several sources of useful information that you can Google for. And developer.apple.com/iphone is the canonical source for information.
If you don’t want to do all this, well, you can just hire me or someone like me to write your iPhone app for you. That works too! Email me at contact@tangozulu.biz.
First things first, you don’t actually need an iPhone to get started, although you’ll want one soon enough. You can program with the iPhone simulator in the development environment, but somethings (accelerometers for example) are not simulated. But you to need a Mac, Windows won’t do. (That’s ok, you need a UNIX box anyhow and that’s what MacOSX is after all. The iPhone is UNIX too. Get over the Windows thing; Microsoft doesn’t let you develop MacOS software on Windows Vista do they?)
1. Get a Mac.
So, get a Mac, any of the laptop pros are good for this. I like the 17 inch, but each to their own. If you have some bucks, get a 3 GHz, 8 GByte memory laptop. Amazing capacity, but you don’t need that level machine to write code for the iPhone.
You’ll need XCode, this is the development environment for the Mac and for iPhone. No worries, this is free. This is listed on the apple site as the iPhone SDK. But, it’s XCode with the iPhone SDK bundled. This is free. But, you’ll have to become an iPhone Dev Center member to download this. You can do a free option, but you won’t be able to download your app onto an actual iPhone with that, you’ll only be able to use the sim. If you buy the membership for $100, then you can later get the cryptographic keys to sign your app and download to an iPhone device.
2. Get an ADC (Apple Developer Center) membership. Spend the $100 for this either now or later.
3. Download and install the iPhone SDK (containing XCode as well) on your Mac and install it. If you have a new Mac, use the Snow Leopard version. Else (assuming you’re not upgraded yet) use the Leopard version. If you’re not running Leopard yet, then upgrade already. You’ll have to.
Ok, you’ve got a working dev environment now. So, “hello world” is next of course. Use this link from Apple to make your first app and try out the dev environment. Run it on the sim, getting it on the iPhone is another issue.
And, if you’ve not done this yet, get an iPhone and use it. Try out some apps and get a feel for what works and what doesn’t. Buy some more apps and try those non-apple apps out too. The point of this is to get a feel for the UI and user experience. Without this you’ll make bad decisions in your designs.
4. Write and run “Hello World” on the sim.
5. Get and use an iPhone if you haven’t yet.
Now, you’ve gotta get your keys. All iPhone apps are signed, and the ones on the iTunes store are countersigned by Apple. You have to 1) get your key to sign your app, and 2) set up your iPhone to accept that for developer purposes.
To get your keys, follow the precise instructions in the iPhone Developer Portal with the Provisioning Assistant there. If you have the free account, you won’t see this. You’ll only see this link when you have your paid account. So shell out the $100 and upgrade already.
You first make a certificate request to the Apple certificate authority, this is the standard public-private asymetric key. The certificate is signed by Apple to make it good. You also have to make a device profile for your iPhone. If you’re a solitary developer the “team” aspect of this is a no-op. If you’re part of a development team, then there’s a hierarchy of controls that can be put into place.
The the second part, you provision your device with your profile and certificate. Beware, XCode 2.x and 3.x are a bit different here. Their directions were 2.x based, and we’re running 3.x. Look under “Code Signing” in the target properties for your application to find the settings they’ll talk about.
Also, note that all this in your profile and provisioning is case sensitive! This created problems for me, either I missed where Apple said it was case sensitive or they didn’t say.
6. Pay your $100 to upgrade your account
7. Request a key
8. Make a profile for your device
9. Provision your device
At this point, you can now put your hello world app on your iPhone and walk around and show it to your family and significant other(s).
Then, learn. Time to exercise your brain and read. The iPhone OS and software development works with ObjectiveC. (Yup, get used to it. I actually like it better than C++.) You’ve also got some massive amount of APIs in the SDK to get familiar with too. Then there’s the human interface stuff and design philosophy. It’s important as this is how Apple does their polished apps. This is a learning curve, but it will help as there’s tremendous amounts of stuff already written for you. You can stride along in seven-league boots making new apps and use all the stuff Apple made for you.
There are plenty of reference materials in the usual well-written Apple style about all this, and about the UI too. But one way to get started is to use the Stanford iPhone class on iTunes U to learn the basics, then expand from that. It was taught by Apple engineers, so that helps.
10. Learn, with online resources or perhaps with the Stanford class.
Or, if you don’t want to do all this, hire me and I’ll write your app for you. So, happy hacking!