0

I work with cross platform code, which means I have to build open-source C++ projects for iOS to use them in my iOS app. Sometimes I have to build my own project, sometimes I get a nice CMake setup, but no two projects seem to have exactly the same settings for these two fields.

Some have "armv7", others "armv7 armv7s" and others "armv7 armv7s arm64". I get that "armv7" refers to a specific generation of device hardware. But does that mean if I only set "armv7" my app won't run on armv7s or the new 64bit iPad? Are these multiple architectures like having fat libraries, with separate copies for each architecture?

Then for "Architectures" there are even more options. Options like "Standard Architectures(armv7, armv7s)" and others like "$(ARCHS_STANDARD_32_64_BIT)". I often find these have to be changed to get things to build, without errors about i386. The fact an iOS project actually gets built for Intel (simulator) as well as Arm just confuses things further for me.

I'm really after a higher level explanation how this fits together than a "use this setting" answer. I want to be confident my app will work on the devices it is intended to, since I cannot afford all the different versions of iPad now in existence. For reference, I want to support iPad 2 and up, and iOS 6/7 only.

bneely
  • 9,083
  • 4
  • 38
  • 46
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589

1 Answers1

0

These are different instruction sets. If you're building a library, you need to build all the different instruction sets/architectures that the downstream application will require, otherwise you'll get linker errors when you try and build the app.

This is complicated by the simulator, which needs Intel x86 or x86_64 rather than ARM.

Based on what you select, the compiler will create fat libraries containing multiple architectures.

There is some compatibility between the different instruction sets at runtime (for instance, 32bit will run on 64bit) but that won't help during linking. If you're compiling 64bit, then the libraries you're including will need 64bit.

So the short answer is set for the devices you're targeting. E.g. you probably don't need armv6 any more.

Community
  • 1
  • 1
Dan Bennett
  • 1,450
  • 1
  • 15
  • 17
  • Does that mean then that if I had an app built with "armv7 armv7s" in the appstore, it wouldn't run on the new iPad Air which is arm64? Surely any app in the App-store will work on future devices without having to be rebuilt? Or are Apple going to remove every single app added to their store built against iOS6 SDK, which hasn't been re-submitted? This is the kind of confusion I have... – Mr. Boy Mar 06 '14 at 11:44
  • Additionally - I still don't understand why _both_ settings are needed and how they relate to each other. – Mr. Boy Mar 06 '14 at 11:52
  • No, an arm64 device will run apps built with 32bit instruction sets (see the first link in my answer). Both settings ? See http://stackoverflow.com/questions/12701188/whats-the-difference-between-architectures-and-valid-architectures-in-xcode – Dan Bennett Mar 25 '14 at 17:44