6

I have recently moved to a new company and am trying to get to grips with the Xcode settings on a project. Currently the project is being compiled for "armv7 armv7s arm64 armv8 i386". Could someone please explain if is necessary to compile for i386 and why?

My project compiles ok if i remove it. One thing to note is that I am linking to a c++ lib which is compiled with the same architectures. Is i386 used for the simulator or any specific iOS devices?

Thanks

Craig S. Anderson
  • 6,966
  • 4
  • 33
  • 46
Stoff81
  • 597
  • 4
  • 15

2 Answers2

8

The i386 version is needed to run your application in the iOS simulator, which runs natively on OS X and uses the underlying x86/x64 hardware. This is way faster than emulating ARM.

dandan78
  • 13,328
  • 13
  • 64
  • 78
  • 1
    A quick note: not all 3rd party libraries run under the sim, which means you'll eventually come across a app where you can only debug on the phone and will have to remove the i386 option from the list. – Maury Markowitz Jun 08 '15 at 12:12
0

You shouldn't need to specifically specify i386 in your architectures build setting. Ideally, you should just leave ARCHS and VALID_ARCHS as default values and everything should "just work". You will only see the arm architectures listed, but the right thing happens behind the scenes when building for the sim.

When building for the simulator, your project will be built for i386, x86_64, or both (depending on the deployment target and the ARCHS and ONLY_ACTIVE_ARCH build settings). In the simulator, 32bit devices are only allowed to run i386 code, and 64bit devices are able to run both i386 and x86_64b code (just like real devices but using intel instead of arm).

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86