本文翻译自:iPhone Simulator suddenly started running very slow
I have been working on an app in iphone simulator for a number of weeks and it has been running well up until now, but all of a sudden has begun running very slow both when loading content and animations. 我已经在iphone模拟器上开发了一个应用程序已经有好几个星期了,直到现在它一直运行良好,但在加载内容和动画时,突然间开始运行非常缓慢。 I have not made any changes to my code since I last tested it successfully. 自从我上次成功测试以来,我没有对我的代码进行任何更改。
I tried restarting the simulator (multiple times) and removing the app and doing a completely clean rebuild, but no luck. 我尝试重启模拟器(多次)并删除应用程序并进行完全干净的重建,但没有运气。 I also checked my cpu usage through the monitor while the simulator is running and I am only using about 30% of my cpu and 40% of memory. 我还在模拟器运行时通过显示器检查了我的cpu使用情况,我只使用了大约30%的CPU和40%的内存。
I fully understand that the simulator is never a quick as the device itself, but it seems strange that it has suddenly started running slow after such a long time, and by slow I mean less than a quarter of its original speed. 我完全理解模拟器从来不像设备本身那么快,但似乎奇怪的是它在这么长时间后突然开始慢速运行,而且我的意思是它不到原始速度的四分之一。
参考:https://stackoom.com/question/12Otf/iPhone模拟器突然开始运行非常慢
Go to the simulator's Debug menu and select "Toggle Slow Animations". 转到模拟器的Debug菜单,然后选择“Toggle Slow Animations”。
Update: In Xcode 10, it's just "Slow Animations": 更新:在Xcode 10中,它只是“慢动画”:
In the iOS simulator, at the bar on the top, click on Debug → Toggle Slow Animations (or Slow Animations with Xcode 10+). 在iOS模拟器中,在顶部的栏上,单击Debug → Toggle Slow Animations (或使用Xcode 10+的Slow Animations )。 Chances are you accidentally toggled it on. 你有可能偶然切换它。
I don't have the rep yet to leave a comment, but I upvoted some answers here and wanted to say more. 我还没有代表发表评论,但我在这里提出了一些答案并希望多说些。 I had a problem with slow animations in the iOS Simulator, especially on rotation, and I found this post via Google. 我在iOS模拟器中遇到动画速度慢的问题,特别是在旋转时,我发现这篇文章来自谷歌。 Indeed, somehow "Toggle Slow Animations" must have been on, because three shifts fixed it. 实际上,某种程度上“切换慢动画”必定已经开启,因为三个班次修复了它。 At first, I didn't think this was a problem because there's no checkmark next to "Toggle Slow Animations." 起初,我认为这不是一个问题,因为“Toggle Slow Animations”旁边没有复选标记。 It turns out there's never a checkmark, or any indication from the menu whether it's on or off. 事实证明,从来没有选中标记或菜单中的任何指示是打开还是关闭。 So just try toggling it and see if the rotation/navigation is faster/slower. 因此,只需尝试切换它,看看旋转/导航是否更快/更慢。
So, thank you! 所以谢谢!
我认为你错误地按了命令+ T而不是命令+ R.
You accidentally pressed the slow animation on debug when using simulator. 使用模拟器时,您不小心在调试时按了慢动画。 So Run Simulator -> Debug -> Uncheck Slow Animation. 所以运行模拟器 - >调试 - >取消选中慢动画。