7

We were supporting iOS 6 & 7 previously for our universal iOS application (which means we support both iPhone and iPad). Now, with the release of iOS 8, we have to support iOS 6, iOS 7 & iOS 8. Also, we have to extend our targeted device list to support iPhone 6 and iPhone 6 Plus.

Also, we are planning to upgrade to Xcode 6 shortly. Because Apple may anytime mandate the use of Xcode 6 to be able to submit apps to app store.

Keeping all the above points in mind, I am confused what should be my Architecture settings in Xcode build settings. Mainly There are 3 important items under Xcode Architectures settings. Please see the below screenshot.

enter image description here

I have highlighted the 3 important parameters. I want to know what values I should assign to these parameters in order to support all the above. Any help will be greatly appreciated. I am confused a bit with this.

Also, I would like to know if i need to change anything else in order to migrate to Xcode 6 and iOS 8.

Rashmi Ranjan mallick
  • 6,390
  • 8
  • 42
  • 59

2 Answers2

5

In Architectures, you'll be fine with armv7, armv7s, arm64, i386, where i386 is for the Simulator. The rest can be left default values.

UPDATE: It is not required to mention desktop architectures (i386, x86_64) in order to support the build for iOS Simulator. Given Simulator is supported just by including respective ARM architecture. Hence, Architectures are fine if populated just with armv7 armv7s arm64. By observing, since Xcode 6.3 it might even cause build to fail if the setting contains any of the desktop architectures.

Valid architectures can be set individually for each target, Xcode will make intersection of the global Architectures setting with this. If you are not interested, leave it untouched, Xcode will cope with that on its own without problems.

In case your code is not 64bit ready, remove arm64 from Architectures. App will still run on iOS 8 and all the recent 64bit devices.

As for the Build Active Architecture Only, I recommend setting it to No. This property affects what Xcode decides to build e.g. based on currently connected device. But it may happen problems arise: you may end-up with some targets are built for different architecture, resulting in linking errors. Nevertheless, if you would like to use the pros of the feature, set it to Yes just for Debug or some sort of configuration used only for testing, not the final release. Xcode will build all binaries only for one of all the architectures you have set in Architectures x Valid then.

lef
  • 1,196
  • 1
  • 9
  • 18
  • I wanted a explanatory answer like this. Thanks!! – Rashmi Ranjan mallick Sep 27 '14 at 14:14
  • This is incorrect. You should just include the arm architectures. Xcode will interpret 32bit arm as i386 for the sim and similarly arm64 to x86_64 for the sim. – Jeremy Huddleston Sequoia Sep 28 '14 at 06:18
  • Proove it. I use exactly what I wrote. – lef Sep 28 '14 at 19:48
  • Ok, as of the recent Xcode 6.3, it seems that somebody fixed the discrepancy and `i386` `x86_64` are no more considered valid architectures for iOS targets. Mentioning them in the `ARCHS` list makes the build fail when `Active Architecture` becomes `x86_64` - that one is not included in `Valid Architectures` list by default, thus `xcodebuild` fails. – lef Apr 14 '15 at 10:31
  • 1
    @lef, please consider update your answer. As I'm not sure its matched with the comments you've added. Thanks for the good explanatory answer. And please let me know here when you do that otherwise I'll never able to know that you've updated your answer. – Hemang Jun 11 '15 at 08:44
  • I have all the above settings, but still get `Undefined symbols for architecture x86_64` when I build for simulator, any idea? – Zennichimaro Oct 05 '16 at 02:37
  • This solution has helped me in running my app on iphone 6 plus with iOS 9.3.5 from Xcode 8. Weird though, that I had to remove arm64 while building for a 64 bit architecture. – Rohan Bhale Nov 14 '16 at 09:05
  • So, it is no longer possible to have a target configured to only show the device (or only the simulators) in the Active Scheme drop down? – Nicolas Miari Nov 04 '17 at 08:44
  • 1
    I had the architectures value correct however i had "build active architecture only" set to YES, and it seems that I had archived my app while an old device was connected, which made the archive not usable with any 64 bit device. setting the "build active architecture only" to NO, and re-archiving fixed my issue! – Dany Balian Mar 19 '18 at 14:47
  • Does XCode support NEON? – Xofo Aug 30 '18 at 21:07
  • on iOS 12 I've started getting errors regarding the i386 and x86_64 archs. I'll drop support for them now. Thank you! – Pedro Góes Sep 21 '18 at 14:45
-2

If you're not an expert on your target architectures, remove all architectures and add armv7 and armv7s. Also, if you're building only for iOS, check your targets so that Xcode isn't building other OSes (that may require other architectures).

pkamb
  • 33,281
  • 23
  • 160
  • 191
Henrik Erlandsson
  • 3,797
  • 5
  • 43
  • 63