2

If I distribute an iOS framework library that detects a simulator at compile-time, the part of the fat binary that’s compiled for the simulator will always work in the simulator, and the code outside the #if TARGET_IPHONE_SIMULATOR macro will always work on a device. So is it really ever necessary to detect a simulator at run-time?

In other words, can the ARM device parts of the fat binary every find themselves running on a simulator?

Community
  • 1
  • 1
theory
  • 9,178
  • 10
  • 59
  • 129
  • 1
    "So is it really ever necessary to detect a simulator at run-time?" and "can the ARM device parts of the fat binary every find themselves running on a simulator?" are totally, completely different questions. – The Paramagnetic Croissant May 27 '14 at 17:31

1 Answers1

6

No, the ARM code can never run in the simulator. The simulator can - by definition - only execute native - i.e. Intel - code. Otherwise, it would be called emulator.

(Android has a device emulator as opposed to iOS' simulator.)

Codo
  • 75,595
  • 17
  • 168
  • 206