使用 Xcode 6 的 iOS 8 模拟器下的应用程序性能缓慢
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26152919/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Slow app performance under iOS 8 simulator with Xcode 6
提问by webchun
After upgraded to xcode 6 I found that when I run my app under iOS 8 in iOS simulator, it ran very slowly, no matter when I choose iPhone or iPad. But if I choose it to run under iOS 7 it ran normally. I was thinking that it was an app/coding related problem so then I tried to deploy it on my ipad with iOS8 and strangely the app run normally, not as slow as simulator does Does anybody on SO experience this issue?
升级到xcode 6后,我发现在iOS模拟器中在iOS 8下运行我的应用程序时,无论我选择iPhone还是iPad,它都运行得很慢。但如果我选择它在 iOS 7 下运行,它运行正常。我在想这是一个与应用程序/编码相关的问题,所以我尝试将它部署在我的带有 iOS8 的 ipad 上,奇怪的是应用程序运行正常,不像模拟器那么慢 有没有人遇到过这个问题?
采纳答案by Jeremy Huddleston Sequoia
Performance in the iOS Simulator is not expected to match performance on device. The iOS Simulator is meant as a tool for rapid prototyping and fast iteration. Performance tuning needs to be done on real devices.
iOS 模拟器中的性能预计不会与设备上的性能相匹配。iOS 模拟器旨在作为快速原型设计和快速迭代的工具。性能调优需要在真实设备上进行。
Processes running in the iOS Simulator are basically OS X processes running in a specially crafted runtime within a special bootstrap to behave like iOS rather than OS X. Over the past 4 years, this has evolved from basically UIKit and similar iOS Frameworks built on top of OS X Frameworks to now having our own bootstrap server (as of iOS 7), our own dyld (as of iOS 8), and only sharing the host kernel and very low level system libraries (libSystem as of iOS 7, and just the pthreads, syscalls, and platform children of libSystem as of iOS 8).
在 iOS 模拟器中运行的进程基本上是在特殊引导程序中的特制运行时中运行的 OS X 进程,其行为类似于 iOS 而不是 OS X。在过去的 4 年中,这已经从基本上 UIKit 和类似的 iOS 框架演变而来OS X 框架现在拥有我们自己的引导服务器(从 iOS 7 开始),我们自己的 dyld(从 iOS 8 开始),并且只共享主机内核和非常低级的系统库(从 iOS 7 开始,libSystem 和 pthreads自 iOS 8 起,libSystem 的系统调用和平台子项)。
When you test an app on a device that is not currently booted, we shutdown the device and boot the new one, and that process can take 10s to a minute or 2 to complete based primarily on your disk's I/O bandwidth and what other tasks on your system are demanding of it.
当您在当前未启动的设备上测试应用程序时,我们会关闭设备并启动新设备,该过程可能需要 10 秒到一分钟或 2 分钟才能完成,主要取决于您磁盘的 I/O 带宽和其他任务对您的系统要求很高。
If you see major performance issues with a sim device that has been booted for a while and don't have any obvious background tasks running (compilation, rsync, whatever), take a sysdiagnose and take a look at the simulator processes in the spin dump and fs_usage to see what's likely going on.
如果您发现已启动一段时间的 sim 设备出现重大性能问题并且没有任何明显的后台任务正在运行(编译、rsync 等),请进行系统诊断并查看自旋转储中的模拟器进程和 fs_usage 以查看可能发生的情况。
回答by PolitikP
Make sure 'slow animations' is not selected under the Debug tab in the iOS Simulator. That fixed the issue for me. It might have been turned on by accident.
确保在 iOS 模拟器的调试选项卡下没有选择“慢动画”。那为我解决了这个问题。它可能是意外打开的。
回答by Eric
If you hit ?T while your simulator is selected it will turn on 'slow animations' which puts everything in slow motion. ?T is often used to open up a new browser tab, so just be sure your browser is selected and not your simulator.
如果您在选择模拟器时点击 ?T,它将打开“慢动画”,使所有内容都处于慢动作状态。?T 通常用于打开一个新的浏览器选项卡,因此请确保选择了您的浏览器而不是您的模拟器。
回答by Pawel Molodkin
Performance simulation and device different things. I think you should not pay attention to it. This error can optimize apple
性能模拟和设备不同的东西。我认为你不应该关注它。这个错误可以优化苹果