ios iPhone模拟器突然开始运行很慢
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15348699/
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
iPhone Simulator suddenly started running very slow
提问by Finglish
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. I have not made any changes to my code since I last tested it successfully.
我已经在 iphone 模拟器中开发了一个应用程序好几个星期了,到目前为止它一直运行良好,但突然间在加载内容和动画时运行速度非常慢。自从我上次成功测试以来,我没有对我的代码进行任何更改。
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.
我完全理解模拟器永远不会像设备本身那样快,但奇怪的是它在这么长时间后突然开始运行缓慢,而且慢是指不到其原始速度的四分之一。
回答by Metabble
In the iOS simulator, at the bar on the top, click on Debug
→ Toggle Slow Animations
(or Slow Animations
with Xcode 10+). Chances are you accidentally toggled it on.
在 iOS 模拟器中,在顶部的栏中,单击Debug
→ Toggle Slow Animations
(或Slow Animations
使用 Xcode 10+)。您可能不小心打开了它。
回答by Tyler Hack
Simple Command+ Twill fix this problem.
Simple Command+T将解决这个问题。
Command+ Ttoggles the simulator's Slow Animations
, which can be found under the Simulator Menu: Debug
-> Slow Animations
.
Command+T切换模拟器的Slow Animations
,可以在模拟器菜单下找到:Debug
-> Slow Animations
。
回答by Caleb
回答by Urvish Modi
Select Simulator,
选择模拟器,
Select Debug and uncheck slow animation.
shortcut
command + t
选择调试并取消选中慢速动画。
快捷键命令 + t
That's work for me.
这对我有用。
回答by jcollum
If the Cmd-T (slow animations) option doesn't work for you and Debug -> Slow Animations
is off but you stillhave slow animations try Simulator -> Reset Contents and Settings
(or possibly Hardware -> Erase All Content and Settings
). That worked for me when none of the other answers in here did. Anyone have a suggestion as to why?
如果 Cmd-T(慢动画)选项对您不起作用并且Debug -> Slow Animations
已关闭,但您仍然有慢动画,请尝试Simulator -> Reset Contents and Settings
(或可能Hardware -> Erase All Content and Settings
)。当这里的其他答案都没有时,这对我有用。任何人都有关于为什么的建议?
Also having a debugger attached(at all) may make the animations very slow.
还附加了调试器(根本)可能会使动画非常缓慢。
回答by Brandon
Another potential fix for React-Native users:
React-Native 用户的另一个潜在修复:
Chrome de-prioritizes Javascript running in any tabs not in the foreground. So if you have enabled remote debugging, be sure to put the debugger in its own window.
Chrome 会降低在任何不在前台的选项卡中运行的 Javascript 的优先级。因此,如果您启用了远程调试,请务必将调试器放在其自己的窗口中。
回答by Digvijay Rajput
You accidentally pressed the slow animation on debug when using simulator. So Run Simulator -> Debug -> Uncheck Slow Animation.
使用模拟器时,您不小心按下了调试时的慢速动画。所以运行模拟器 -> 调试 -> 取消选中慢速动画。
回答by Saad Ur Rehman
I think you pressed command + T instead of command + R by mistake.
我认为您误按了 command + T 而不是 command + R 。
回答by Geoff Hom
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. 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." 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.
我还没有代表发表评论,但我在这里提出了一些答案,并想说更多。我在 iOS 模拟器中遇到动画缓慢的问题,尤其是在旋转时,我通过 Google 找到了这篇文章。确实,不知何故,“切换慢速动画”一定是打开的,因为三班制修复了它。起初,我不认为这是一个问题,因为“切换慢速动画”旁边没有复选标记。事实证明,从来没有一个复选标记,或者菜单上的任何指示是打开还是关闭。所以只需尝试切换它,看看旋转/导航是否更快/更慢。
So, thank you!
所以谢谢!
回答by smmaca
Simulator -> Reset contents and settings works for me. The issue seems to reappear when I debug my react-native code remotely. It could also be to do with AsyncStorage as nomad suggested.
模拟器 -> 重置内容和设置对我有用。当我远程调试我的 react-native 代码时,这个问题似乎再次出现。正如游牧者建议的那样,它也可能与 AsyncStorage 有关。