Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build for armv6 and armv7 architectures with iOS 5

Tags:

ios

ios5

In iOS5 Apple drops the armv6 architecture from the ARCHS_STANDARD_32_BIT.

In order to keep the support for iPhone3G I still want to compile in armv6 even in iOS5.

Did anyone find a solution for this?

like image 280
iGranDav Avatar asked Sep 20 '11 16:09

iGranDav


3 Answers

I just built something today specifying a deployment target of iOS 4.0. With only armv7 specified in Architectures, Xcode warned me that to support anything below iOS4.2 I had to include armv6 in Architectures. Just edit that field, click the "+" button when the dialog pops up and enter the literal "armv6".

In my case, we want our app to work under iOS4 and iOS5. We had to make some modifications so it would work correctly under iOS5, but all those changes were done with iOS4-friendly code changes.

We also added some iOS5-specific capabilities in a manner that allows the app to run without crashing under iOS4. Specifically, we tested for iOS5 capabilities before trying to use them, and linked iOS5-only libraries as Optional.

So, supporting iPhone3G in an iOS5 world could just as easily mean "we want our app to run on iOS4 and above (regardless of any iOS5 feature use)" rather than "we want to make sure our app runs on an older device running iOS5". There's a difference here; think about it. :-)

Anyway, adding armv6 support back in is very easy. And I guess the point is this: At some point, when there are no more armv6 devices out there to worry about (for whatever reason) you won't have to build for it. Apple's view is everyone should upgrade to the latest hardware as soon as possible. So in that world, there is no need for the tools to default to anything but the latest and greatest too. :-) Fortunately (or not), we developers live in the real world and recognize that you have to support older stuff for a while. And I guess the Xcode dev team knows this too, which is why you can add armv6 support back in quite simply.

like image 169
Mark Granoff Avatar answered Oct 07 '22 11:10

Mark Granoff


The simple answer is that you have to change the current settings from "Standard (armv7) - $(ARCHS_STANDARD_32_BIT)" to just be "armv6" and "armv7". See the image below. You have to delete the line with the previous settings for it to work.

Correct settings for armv6 and armv7

like image 51
adjwilli Avatar answered Oct 07 '22 11:10

adjwilli


also make sure you set this in Project AND Targets ... cost me an hour to figure that out. had set it for one but not the other. hope this helps. GLTA

like image 11
ubert Avatar answered Oct 07 '22 10:10

ubert