theory
theory

Reputation: 9897

Can iOS ARM code ever be run in a simulator?

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?

Upvotes: 2

Views: 1786

Answers (1)

Codo
Codo

Reputation: 78985

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.)

Upvotes: 6

Related Questions