When is it necessary to compile for i386 on iOS
Asked Answered
K

2

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

Kiele answered 8/6, 2015 at 11:11 Comment(0)
M
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.

Metatarsus answered 8/6, 2015 at 11:16 Comment(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.Mindy
G
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).

Gurkha answered 9/6, 2015 at 0:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.