Why is iOS Simulator build targeting x86_64 on Apple Silicon Mac?
Asked Answered
C

0

9

I've recently had to introduce a library (GoogleMLKit, using Pods) that doesn't support arm64 on simulators.

  • I can build for the iPhone device, which is arm64, perfectly.
  • I can build for Rosetta iPhone simulator (from Product > Destination > Destination Architectures > Show Both) which is x86_64, though I don't want to run under emulation.

If I try to build for simulator on arm64 (non-Rosetta) Xcode gives linker errors for x86_64 referenced from newly added Google libraries and their dependencies.

  • Why is it building for x86_64 on an Apple Silicon Mac targeting an arm64 simulator in the first place?
  • Why is it compiling perfectly for iPhone, which is arm64, but failing for iOS simulator while linking (the still-don't-know-why-its-there) x86_64 version of my app? - Why can it compile x86_64 when building for Rosetta, but fail to compile x86_64 on non-Rosetta?

And most importantly:

  • How can I get rid of everything x86_64 and build only for arm64, which is the only architecture I need to build for both simulator and iOS device anyway?

I've tried excluding arm64 and/or x86_64 for my pods in my podfile but no avail.

I'm on Xcode 15.0.1.

Cripple answered 15/11, 2023 at 19:45 Comment(2)
Have you managed to fix the issue? It's maddening how there's no documentation about this :(Misshape
@Misshape unfortunately, not.Botfly

© 2022 - 2024 — McMap. All rights reserved.