iPhone 模拟器实际上与设备本身一样 "slow"

Is the iPhone Simulator actually as "slow" as device itself

我想知道 XCode "really" 中的 iPhone 模拟器是否模拟设备硬件。 因此,当部署到 iPhone 4s 模拟器时,我的应用程序实际上会是 "as slow as on a real iPhone 4S device" 并且当使用 iPhone 6 模拟器时,它会像在真实设备上?

The Simulator is a useful tool, and it should not be the only way you test an app. Because the Simulator is an app running on a Mac, it has access to the computer’s resources, including the CPU, memory, and network connection. All of these resources are likely to be faster than those found on a mobile device. As a result, the simulator is not an accurate test of an app’s performance, memory usage, and networking speed.

Source

模拟器在指示应用程序性能方面做得非常糟糕。事实上它并没有尝试。

对于大多数事情,模拟器比 iOS 设备快得多。它 运行 是 x86 处理器上的代码,它比 ARM 快得多,内存也多很多倍。 (它实际上也再次链接了 OXS 框架,而不是 iOS 框架。模拟器中有胶水代码可以使用 iOS 代码,但它并不完美。)

但是,有些东西,例如 Core Image 滤镜和 OpenGL 图形,在模拟器上实际上比在真实 iOS 设备上慢。

最重要的是,您无法从模拟器中真正了解您的应用程序的性能,也不应尝试。您可以在 sim 上进行基本开发,但是当需要测试性能时,请使用真实设备,并确保在您的应用程序支持的 oldest/slowest 设备上进行测试(通常是 iPhone 4s 或 iPad 2).

您也无法在模拟器上测试内存使用情况。一个 运行 内存不足并在 iOS 设备上崩溃的程序可能 运行 在模拟器上没问题。