有没有办法设置模拟器在有限的内存上工作?

时间:2014-01-04 11:26:06

标签: ios ios-simulator xcode5

众所周知,模拟器的内存比设备多。通常,unit testing每个开发人员在设备上测试项目之前使用模拟器,但有时在设备不可用的情况下,是否可以在有限的内存上设置模拟器工作?

例如,工具栏中是否有任何选项可以在16GB / 32GB内存上设置模拟器的内存,这样如果我们将内存限制设置为16GB,它将与具有16Gb内存的iPad一样工作。

1 个答案:

答案 0 :(得分:1)

我想这会解决您的问题: - Is there a way to set the amount of memory available in the iPhone Simulator?

更新(复制以下链接的内容): - https://discussions.apple.com/thread/3870841?tstart=0

不可能。模拟器是OS X应用程序,因此您无法控制内存分配。有关详细信息,请阅读有关OS X内存管理的部分: https://developer.apple.com/library/ios/#documentation/Performance/Conceptual/ManagingMemory/ManagingMemory.html#//apple_ref/doc/uid/10000160i

更新2: -
Even though iOS Simulator is a useful tool, never make it the only way you test an app. Because iOS Simulator is an app running on a Mac, it has access to the computer’s memory, which is much greater than the memory found on a device. As a result of the increased memory, iOS Simulator is not an accurate test of an app’s memory usage. For this same reason, you should always test the performance of your app’s user interface (UI) on a device. In iOS Simulator, your app’s UI may appear to run both faster and smoother than on a device.
参考链接: - https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/TestingontheiOSSimulator/TestingontheiOSSimulator.html