Build for armv6 architecture (target iOS 3.1.3) with iOS 6 SDK and Xcode 4.5?

Björn Marschollek picture Björn Marschollek · Sep 21, 2012 · Viewed 10.4k times · Source

is there a chance to use the iOS 6 SDK to develop applications that target iOS 3.1.3? If I open my project with the old deployment target, the compiler warns me:

iOS deployment targets lower than 4.3 are not supported

This is probably due to the fact that apparently only armv7 and armv7s binaries can be built. If I add armv6 (working in devices until the iPhone 3G) manually, there are several warnings as well:

warning: no rule to process file '$(PROJECT_DIR)/main.m' of type sourcecode.c.objc for architecture armv6
...
...
warning: architecture armv6 is not supported (current ARCHS = "armv6 armv7 armv7s").

So how do I deal with this? Is there a way to support iOS 3.1.3 while developing with the iOS 6 SDK? If not, I will eventually have to move to the lowest target to be iOS 4.3. Is it even possible to submit a new version that supports only versions >= 4.3? What happens to my users on earlier versions? Are they simply not being informed about the incompatible update and hence going to continue to use the older version of my app? If not, can this be achieved?

Answer

MattyG picture MattyG · Sep 25, 2012

oonoweb's answer is correct regarding iOS SDK 6.0. It's not possible to support below iOS 4.3 while building against iOS 6 SDK, but it is possible to use Xcode 4.5 to continue to build for armv6 and target iOS 4.2.1 and below.

The trick is to build against iOS 5.1 SDK instead of 6.0. Note: you won't be able to use any of the new iOS 6 specific features if you do this:

chpwn's blog lays out the steps, which I've re-written:

  • Download Xcode 4.4.1 from Apple Developer Downloads (you don't need to instal it)
  • Open the .dmg, right click on Xcode.app, 'Show Package Contents'
  • Find the iOS 5.1 SDK within that package at: Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/
  • Copy this SDK
  • Open the package contents of Xcode.app (4.5), and paste the 5.1 SDK in the location: Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
  • Open your project in Xcode 4.5. Go to your Target > Build Settings tab > Base SDK, and choose iOS 5.1 from the dropdown
  • Again in Build Settings tab > Valid Architectures - remove armv7s if it's there, and add armv6 if it's not there already.
  • Go to the Info tab > Deployment Target, and type 3.1.3 (or whatever you're supporting down to) into the dropdown (the option won't be there, but you can type it in).
  • You can now delete Xcode 4.4.1 .dmg if you don't want to install it.

You'll get warnings about talking about no rule to process files for armv6. Nate has recently posted this answer to deal with those.

If you're creating a new project (instead of maintaining old ones) you may also need to view the ***-Info.plist file, and remove armv7 from the 'Required Device Capabilities' if it's there.