Mobile Security & Software Experts
The original iPhone, iPhone 3G, and first two generations of iPod touch used processors supporting the
armv6 instruction set. However, with the iPhone 3GS, Apple moved to the more modern, but backwards compatible,
armv7 instruction set, and the iPhone 5 includes
armv7s. To support older devices while taking advantage of the capabilities of the newer processors, iOS supports fat binaries, which are multiple executables, each for a separate instruction set, combined into one.
But with the latest release of Xcode (as I write this, version 4.5), Apple removedsupport for building
armv6 components, essentially forcing developers to drop support for iOS releases up through iOS 4.2.1, the last supported version on the
armv6 devices. I like supporting older devices for a long time, though, so dropping support for anything before iOS 4.3 so soon isn’t what I would want. Luckily, however, with a minimal amount of hacking, you can convince Xcode 4.5 to build your code for
armv6and for iOS 4.2.1 and below — as long as it doesn’t build against the iOS 6 SDK.
Here’s how to do it:
armv7s(iOS 5.1 was before the iPhone 5 was announced), but we can build for
armv6, so edit it and swap
armv6, but your apps still won’t run on any
armv6devices, since the deployment target is still something at or above iOS 4.3 — which no
armv6devices can run. Under “Info”, change that to whatever target you want, from iOS 3.0 or later. You won’t find that version in the drop down, though, so you’ll need to type it in manually.
And that’s all there is to it. It’s not perfect: you can’t use the iOS 6 SDK when using this trick, and you can’t build for
armv7s. And you might need to re-add the iOS 5.1 SDK after you update Xcode through the App Store. But you can use one set of developer tools to build both iOS 6 apps and older ones, which is likely enough if you’re bothering to support the iPhone 3G in the first place.