Friday, October 21, 2011

Setting Up Xcode to Support Old iPhones

The iPhones from v1 to v3G all use the armv6 architecture
The iPhone 3GS and above all use the armv7 architecture (this is why it is not a really big deal that Apple has decided to continue to sell the iPhone 3GS)

The phones that run the armv6 are mostly on iOS 3.1.3. It is possible to pus 4.2.1 on an iPhone 3 but it runs so….very…..slowly….that most people have downgraded back to 3.1.3 or else bought a new phone. The 3GS runs iOS 4.x and 5.x pretty well so there is no reason for people with a 3GS or above not to be on 4x or 5x. The 3GS had some issues with iOS 4.0 but those speed issues have been addressed and any 3GS you purchase today will have IOS 5 on it.

As is their general theme, Apple hates supporting old things so the defaults in Xcode 4 (and 4.2 which is the current version) assume that everyone is running iOS5 and that they have a 3GS or better device. That is a reason the simulator only has options for 4.3 and 5.0 software. If you read this article from Apple Insider you will get a nice graphic showing how hard Apple is pushing iOS 5 and on what devices it runs.

To make your Xcode compile code for an old iPhone you have to do two things:
In Build Settings for your target, change the "Compiler for C/C++/Objective-C to LLVM GCC 4.2 (this is not the default)
In Build Settings for your target, change the "Architectures" from "Standard (arm7)" to "armv6 armv7"

You should also check these two settings since Xcode is going to want to have the Deployment Target be the latest version of the OS by default.
In Build Settings for your target, make sure that "iOS Deployment Target" is set to "iOS 3.0" or whatever the minimum you will support is
In Build Settings for your target, make sure that "Base SDK" is set to "Latest iOS (iOS 5.0)"

Now, you should be able to install and compile things on the old phones. The above settings are for ALL projects you create where you want to support older devices.

Update: Others are having this problem and posting similar fixes. I think I like this fix for the armv6 issue over at Retro Dreamer better.

No comments:

Post a Comment