Developing for the iPhone

I read a lot of Mac developer blogs. Everyone wants to write applications for the iPhone. Why? First of all, because it's a new device, and developers are nothing if not relentlessly curious about new devices. Also, developers see an opportunity for the iPhone to take Cocoa apps where no Cocoa app has gone before.

iPhone OS X Slide

The extreme portability of the device is the key. Even if the iPhone could not make a single phone call, Mac developers would be absolutely thrilled to use Cocoa to write apps for a handheld Mac. The keynote explicitly calls out the fact that the iPhone has a version of Mac OS X running on it.

Developer Considerations

Aside from the Apple and Cingular side of the world, there are some things that developers would have to consider for development:

1. The iPhone is not Intel-based. It appears to be ARM-based. For many newer apps, this is a not a major issue. In theory, it's up to the framework to figure out the lower level details. Still, many apps dig down into C for various reasons.

2. Since the iPhone is a phone, Apple has to cooperate with Cingular. It's hard to know all of the details of the relationship, but it's clear Cingular has some sort of say here where they would not a pure Mac handheld. For example, maybe Cingular isn't thrilled with the idea of a VoIP app.

3. Multi-touch changes the way you need to think about user interface. I'm surprised this hasn't gotten more attention. It's not like you plug in a mouse to the iPhone and go. Each of the demoed apps has been specifically tuned for a particular type of hand gesture. How difficult is this to develop for? I personally don't know.

All of that said, there's a lot of potential value here. At least some users want software from Mac developers on their phones, and developers want to provide it. It seems Apple would want to connect them at some point, but if that is ever going to happen, they'll want to stabilize the API first.

User Support Considerations

The only reason given by Apple for not supporting third-party apps was that "Cingular doesn’t want to see their West Coast network go down." A lot of people pounced on this. The tricky thing about interviews is that it's very easy for quotes to be misinterpreted, particularly when translated to text.

For example, what does does it mean for the network to go down? If an app simply mucks up a lot of phones — in other words, people cannot make or receive calls — from Cingular's perspective, parts of their network are down. Not in a central location, but individual units out in the field. I think this is at least as likely of an explanation as anything.

There's no precedent for putting OS X on a handheld device, and selling it to iPod users. Mac OS X's frameworks provide a much bigger toolbox than what carriers are used to. Opening up for general development is not a simple decision, particularly because it involves Cingular (they get the support calls). And once you open it up, there's no putting the genie back in the bottle.

Apple is specifically going after customers that are not interested in the complexity of existing smart phones. Users can paint themselves into a corner very quickly. Anyone who provides tech support to relatives understands this. When you need to make a call, it's a much bigger deal than when you need to listen to a song or watch a video.

I'm not trying to sell anybody on this. Either you agree or not, but this really is a different game. I'd love to write software for the iPhone, but I realize there may be things I don't know about the device or Apple and Cingular's relationship. Maybe a compromise is to allow apps to be added via direct connection rather than over the air.

Either way, it's Apple's device so it's their decision to manage it in the way that they thinks makes the most sense. We can provide feedback as developers, of course.


One mystery is why Apple calls the iPhone's software "OS X" instead of Mac OS X. It might be a way to make it clear that this is not Mac OS X, but a version of the core of Mac OS X. It could be that Apple is only supposed to promote Macs on Intel right now.

Perhaps Apple doesn't entirely trust Cingular to handle the Mac brand or would simply like to make the purchase less confrontational for Windows users. Or maybe there's just a preference for Apple branding in the spirit of Apple TV.

These are all just guesses. There's just not enough information to know for sure. Maybe it will become more clear in the future. Even if there's no iPhone SDK in the wings, it seems like this could be an interesting year for WWDC.

Cocoa Blogs Macworld 2007

I'm tracking a lot of these discussions on a special page Cocoa Blogs. Updates were a bit thin for a few days, but I'm filling it in now.
Design Element
Developing for the iPhone
Posted Jan 14, 2007 — 28 comments below


Josh Pyles — Jan 14, 07 3228

I really think Apple is shooting themselves in the foot by not making this an open platform. It really should work as a widget system. You should be able to write widgets for this platform, if nothing else. I don't see how if it's a widget that it could distract from the main function ( the phone). crazy.

Scott Stevenson — Jan 14, 07 3229 Scotty the Leopard

I think they've left themselves enough room in the PR stuff to allow for widgets, which makes even more sense given the recent spotlight on Dashcode.

Ben — Jan 14, 07 3230

@ Josh: When Apple opens the iPhone to 3rd party stuff, it will almost certainly be in the form of Widgets, which might well end up being cross-compatible in some form with desktop OS X (write with Dashcode, deploy anywhere). But it's not just a potential usability distraction. A poorly-written widget could suck a lot of data across the mobile data network, and if it becomes popular, then Cingular bears the brunt of all that unnecessary traffic on their network. There are ways to get around this, such as building network throttling into the iPhone OS's widget runtime environment, etc. But it's not surprising that this won't be available or ready on day 1-- it's an eminently cuttable feature for the v1 product.

Apple is not shooting themselves in the foot here. You'll notice that no one besides developers are currently clamoring for 3rd party apps on iPhones, and for the immediate future, Apple will do just as good a job as anyone else could in providing the obvious functionality for the phone. As time goes by, it might well become worthwhile to open it up and find out who can add more value there, but it ain't necessary now.

Re: naming of OS X versus Mac OS X. I'm fascinated by how much attention this has gotten. It seems quite obvious to me that an iPhone is not, in any meaningful marketing sense, a Macintosh, just as an iPod is not a Macintosh. Macs are the computers, yeah? Why would you ever refer to what the phone is running as "Mac" anything? It's not a Mac Phone, thus it doesn't run Mac OS X. <shrug>

What they're running on the phone is almost certainly a Darwin kernel with special drivers, some desktop-similar frameworks, and a iPhone-specific shell/window manager. They call it out as OS X to communicate the relative sophistication of the platform and imply its relationship to the desktop OS.

Josh Pyles — Jan 14, 07 3231

Yea I agree that it could cause network trouble, but I think it could be prevented. Honestly, Pocket PC and Palm both have *smartphone* versions of their products that could potentially do the same thing but they put in protection. It's not that the device has to have it, but the potential is so great, and if i am going to spend 5-600 bucks on essentially a mini macbook, it better have support for 3rd party programs. Especially when I can get a blackberry or even a free phone that supports 3rd party programs for much cheaper. I love the iPhone, but i am just really dissapointed that we can't program for it, or customize it. After all, I would love to make keynotes, and pages documents, and just use it as an ultra-portable. Just my opinion :)

The boy Ken — Jan 14, 07 3233

Although I too would love to develop for the iPhone (despite them not coming over here to the UK until the end of 2007), I can see Apple's reticence to allowing 3rd party developers free reign of the device:

[1] If you install software that wrecks your mac (eg. dodgy kernel drivers... most applications should only wreck their sandbox, not the entire mac (even more so when they're not actually launched)), then there are plenty of things you, the user, can do to repair your mac (boot off alternative disks, run diagnostic tools, dip down to the command line etc.) - this may not be true of the iPhone - it isn't too easy to perform your own iPod repairs aside from reset / reboot / diagnostic menu (if my memory serves), and there aren't an awful lot of holes on the iPhone for diagnostic work (eg. booting off a USB / FW disk / CD). Bearing in mind most 'users' for iPhone will not be IT savvy (as is the case with most iPod users), they will not necessarily realise that what wrecked their iPhone was that dodgy bit of software they just installed on it. And Cingular / European distributors / Asian distributors will be the ones having to support these kamikaze users.

[2] To the argument that 'at least Apple could enable widget development even if not full app development', I don't think that's so safe either: a Mac OS X widget doesn't just have to involve HTML / CSS / Javascript, it can use Objective-C objects. These can call C code, the BSD libraries (on Mac OS X at least, not sure about 'iPhone OS X' of course), and there's even the NSTask Objective-C class to do some of your UNIX bidding for you. So to allow cross-platform widget development (for macs & iPhones, using the same widget) would be no more secure (from stopping the phone from crashing) than to allow full API access. Of course Apple could insist iPhone widgets can _only_ do HTML/CSS/JavaScript, so that there's no risk of Obj-C / C / BSD stuff going on, but then they break any notion of a cross platform widget (if that were even on the table).

So as I say, much as I'd love to be developing for the iPhone, I can see why Apple isn't yet saying you will be able to make widgets for it.

Lieven Dekeyser — Jan 14, 07 3234

The second Steve Jobs told us this thing was running OS X, I thought "Adium! Skype! NetNewsWire! SSH! VNC!". Then about 2 seconds later I started imagining the stuff I could write for this thing myself, uploading photos I've just taken to my website, advanced remote control for my mini,...

There is a difference between Pocket PC, Palm, Blackberry and the iPhone: target audience. Apple is going after the masses (not with this release and at this price point, but eventually they will), and so it poses a greater risk than the existing devices that are just used by some geeks and business types.

I think a simple solution would be to let 3rd party applications run in a managed environment and allow for different levels of access to the network.

For example, unsigned applications would not get network access at all, signed 3rd party applications could get access to the wireless network, and only applications that have been signed and verified by apple or cingular (I guess that would pretty much mean only apps from apple or cingular themselves) could get access to the GSM/EDGE network.

An application could for example be allowed to provide a number to the phone call application but would not be able to initiate the call.

Scott Stevenson — Jan 14, 07 3235 Scotty the Leopard

I think a simple solution would be to let 3rd party applications run in a managed environment and allow for different levels of access to the network
This makes a tremendous amount of sense to me. It still leaves the question of users messing up their phones, though. I think that's a bigger deal for an iPhone than a Treo, given the target market.

If the user downloads an app that causes local problems one way or another and can't make phone calls, they'd blame Apple and/or Cingular, not the developer. I suspect that's at least one factor in the decision about third party apps.

Klep — Jan 15, 07 3236

Someone above pointed out, "You'll notice that no one besides developers are currently clamoring for 3rd party apps on iPhones."

That's because nobody *has* an iPhone yet. As developers, it's our job to think ahead. To build things that users want and need before they actually know that they want and need them. On day one that the iPhone is available, people will bring it home and say, "okay, how do I download an OpenOffice viewer? Where can I find some cool add-ons that customize the way the interface looks?" None of that will exist unless Apple wants it to.

It's clear that this is just a case of Steve being Steve. He wants to build a complete end to end solution, like he did with the iPod. He doesn't want any third party developers doing anything to mess that up. It has nothing to do with Cingular, which allows other Smart Phones to have software, or any technical limitations.

And to those who say that the iPod is better for being a closed environment, consider the difference between a music playing device and a device that claims to be a communications device -- a do-anything device. The iPhone is not an iPod -- it's designed to be general purpose and it will fail its users and Apple's developers if it lacks true support for third party applications.

The most frustrating part is that Jobs went ahead and said the phone had Cocoa -- why even list a developer technology among the features if you're not going to make it available to developers?

Martin Kahr — Jan 15, 07 3237

Providing a framework or API has a big impact on the development process. Especially when you are developing such an innovative product. The iPhone product team focused to get out a great consumer product not an API.

I guess we'll see an iPhone widget kit first. It will be HTML/CSS/JS only and comparable to J2ME environments (so add a bit of sound and graphic stuff).
For most users it will be of more interest (in the short term) if there is a sync API on the Mac/PC side to connect it with Outlook, Entourage, Lotus Notes....

David Cairns — Jan 15, 07 3238

For example, what does does it mean for the network to go down?

Last year, two professors at my school wrote a paper in which they detailed how a malicious computer could relatively easily take down a large portion of a cell phone network by sending text messages. Cell phone companies were not pleased. My school (Penn State) doesn't get much press attention when it comes to computer science research, so that was kind of cool.

Anyway, think that might have anything to do with it?

Furthermore: Note that Apple Specialist Resellers will not be able to sell the iPhone when it launches: only Apple retail stores and Cingular stores (also the online store, I think...). Sucks, but I guess people have to buy it with a plan. Thoughts?

David — Jan 15, 07 3239

I suspect that the reason this is a closed box has more to do with business than it has to do with technical details or fears that "my iPhone killed the phone company!".

Closed platform == control. Apple, and possibly its business partners (of which Cingular is only one) gets to control this entire market just as it controls the production and distribution and profits of applications for the iPod. Certified apps, certified developers need only apply. Cleverly, Apple is able to drawn on the resources of the Mac developer community, yet doesn't have to open up their devices to the (possible) competition from that very same community.

wombat — Jan 15, 07 3240

Apple has launched a prototype of an iPhone. That's why there is so little technical information. Of course the real iPhone will be open to developers, but at the moment there isn't such a thing as iPhone. An excellent market research idea from Apple. Launch a non existent product that no one can buy or develop software for, listen to public opinion (e.g hard disk too small, closed vs opened platform, no 3G support), and design the real product according to potential users feedback.

Rainer Brockerhoff — Jan 15, 07 3241

Scott, I wrote several posts on that subject. Basically, I feel that Apple will open up development to selected developers during WWDC, meaning soon after Leopard is out. Should a high-end iPod or low-end OS X tablet come out at that time (IMHO 99% certain to happen), that would make a nice sandbox/developer platform, and they could certify selected apps for that to migrate to the iPhone.

Scott Stevenson — Jan 15, 07 3244 Scotty the Leopard

@Wombat: and design the real product according to potential users feedback
Does the FCC have to approve the real product?

David Young — Jan 15, 07 3246

I think it's interesting that "OS X", "Cocoa", and "Core Animation" in the Keynote were essentially marketing points. I can't see how these things matter to the end user save for their associations with the brands -- i.e., "Cocoa == stable", "Core Animation == glitzy". I mean, listen to the crowd's reaction in the Keynote video -- the response to "it runs OS X" was almost as loud as the response to "it's the iPhone!"

I'm not so sure anymore that the closed platform will open up in time -- the iPod still hasn't, even after a couple of years and a hundred million units. Perhaps the thing for us to understand is that the Mac desktop world, and its rich culture of independent developers, is an oasis; the future of desktop applications looks pretty dry on other platforms. MacHeist sold 16K bundles in a week? Steve's looking to sell 10M units in the iPhone's first year.

Apple's off chasing Hollywood and high-volume devices because that's its best bet for future growth. But the indie market? Even if you sell 100K copies of your app in a year, that's %1 of 1% of the market in which the iPhone plays. Food for thought, I guess.

Scott Stevenson — Jan 15, 07 3247 Scotty the Leopard

@David Young: I can't see how these things matter to the end user save for their associations with the brands
Maybe the Cocoa and Core Animation stuff was more for analysts?

I'm not so sure anymore that the closed platform will open up in time -- the iPod still hasn't
I'm not sure how much that tells us. Writing software for an embedded device like the iPod is not usually easy. The reason the iPhone is attractive for developers is because of Cocoa. If Apple never said it ran Mac OS X, I'm not sure we'd have nearly as much discussion about an SDK.

wombat — Jan 15, 07 3248

Scott I don't know what FCC is but I presume it's some sort of telecom authority? I am not sure what the approval process involves, but I have never ever seen a situation where a company like Nokia (or some Chinese no-name) would release a new phone and then wait 6 months for approval. Sounds like an excuse. Just what Apple wants people to believe.

The strange time between iPhone being launched and it's availability and little technical information makes me think that iPhone really is a product that does not exist yet, or at least it's not fully implemented.

Scott Stevenson — Jan 15, 07 3249 Scotty the Leopard

but I have never ever seen a situation where a company like Nokia (or some Chinese no-name) would release a new phone and then wait 6 months for approval
All handset makers need FCC approval to sell their devices to the public. The only difference is that Apple likes to announce their own products rather than have the FCC do it for them via public filings. I doubt they'd be allowed to drastically change the hardware between now and the release date, but I'm not sure how those details work.

makes me think that iPhone really is a product that does not exist yet, or at least it's not fully implemented
It's certainly not done, but it would have to be a real product in order for the FCC to begin the review process.

Lemont Washington — Jan 15, 07 3250

I think the primary reason we may never see an SDK for the iPhone is simply to protect iTunes revenue. I don't think Apple is so concerned with someone writing a VOIP client. But what if REAL, MS with the Playforsure, Yahoo Music or any other music distributor decides to write a client to sell content, wouldnt taht completely Usurp Apple's ability to sell exclusively?

Scott Stevenson — Jan 15, 07 3251 Scotty the Leopard

I think the primary reason we may never see an SDK for the iPhone is simply to protect iTunes revenue
This is an interesting insight. I remember meeting you at WWDC, by the way. Just found your card recently.

Ben — Jan 15, 07 3253

simply to protect iTunes revenue

Doubtful. Apple only makes the barest profit on iTunes purchases; they essentially run the service at break-even to provide a complete end-to-end content story for the iPod ecosystem. Their profit comes from the margin on the device, and on the iPhone they will have already collected the big profit when you walk out of the store with the phone. If having an open platform allows them to sell appreciably more phones (with all the usability solutions that entails), they will happily do so.

Lemont Washington — Jan 17, 07 3300

Hey Scott! It was nice meeting you finally at WWDC. I think it was in the Objective C 2.0 session. You know what would be a good idea.... I know Apple wants to protect the iPhone platform, it would be nice if they allowed registered ADC members to buy some special version of the phone or somehow unlock it so we can write apps that we want to use in our own fields or for personal use. That way Apple can keep an eye out for what gets produced from third parties without worring about marring the average consumers experience with the iPhone. They could even approach developers who's apps interest them. I think this would be a good compromise. Because lets be honest, most of us don't really expect initially for this to be a lucrative market (it will at some point) but a lot of us probably really want to code this for ourselves. How cool would it be to use the proximity sensor to turn your machine's screen saver on or to write an app that does something specific to your needs. id easily pay 1000$ for that privilege. Yeah, apple should charge an arm and a leg for a special developer version of the iphone.

Bret — Jan 18, 07 3320

The solution is simple and obvious: a developer-only version of the iPhone OS available from ADC with select or premier membership, under the same terms as your seeds (i.e., NDA), that when installed allows you to run apps signed with your key, a new version of Xcode that targets the iPhone, and the only way to get a 3rd party app to install on a consumer iPhone is to first demonstrate to Apple (via the compatibility labs, perhaps?) that it's safe (then they will sign it with their "blessed" key). Additionally, the developer version of the OS could require a special SIM card, only available to registered ADC select or premier members.

You, as a developer, leak the developer OS version? Face the lawyers (same as if you leaked the Leopard seeds, or any other Apple confidential stuff).

You, as a consumer, download the leaked developer OS version? Not only will you face the lawyers (they'll know the instant it logs on to the Cingular net and, um, "phones home") but you will have your SIM card immediately canceled, and you won't be able to get a new one.

See... simple! Quality 3rd party apps, without the hazard to consumers, Apple, or Cingular. :-)

kr — Jan 18, 07 3324

> For example, unsigned applications would not get network access at all

Puh-leaze, all those generations of Java-enabled or Symbian phones haven't taken down the networks over here in Europe yet so why should evil apps for the apple phone do this to the precious cingular network?

This is just about making more money would kill the iPhone in the end.

Blain — Jan 18, 07 3344

Oh, duh. I just realized that there is a garuntee that there will be third-party widgets, if not full apps, on the iphone. The reason rhymes with high-spod fennector.

Storing the OS on flash and the need for firmware updates and resetting garuntees that the OS will be acessable, even if hidden. Linux on the iPod Nano testifies that people will get software where it's unofficial. Linux on ARM chips tells us that the CPU is openly gcc-supported.

And the hacking to get XP running on an intel iMac means people are willing to brickify expensive equipment in the name of science.

I predict that less than a month after iPhone's release, there'll be extensive reverse-engineering on how to hack OSX on the net. The widgets that are there will be geeks' hello world. Apple will turn a knowing blind eye to it, just so long as it doesn't become too easy (See MacOS on Dells) and sell approved apps through iTMS.

Cingular, on the other hand, will sternly resist, and probably start a cat and mouse game to lock down the phones.

It shoud be fun!

kr — Jan 19, 07 3353

> Storing the OS on flash and the need for firmware updates and
> resetting garuntees that the OS will be acessable, even if hidden.

I'm quite sure that implementing a solution where the iPhone only accepts signed and encrypted firmware is doable if not easy.
Maybe even with individual keys for every iPhone.

Condra — Aug 14, 08 6248


Bit OT but I just wanted to say how nice the design of your site is.

Take care.

Scott Stevenson — Aug 15, 08 6249 Scotty the Leopard

@Condra: Bit OT but I just wanted to say how nice the design of your site is.

Many thanks.


Comments Temporarily Disabled

I had to temporarily disable comments due to spam. I'll re-enable them soon.

Copyright © Scott Stevenson 2004-2015