我已经在iphone模拟器上开发了一款应用数周了,到目前为止它一直运行得很好,但在加载内容和动画时突然开始运行很慢。自从上次测试成功以来,我没有对我的代码做任何更改。

我尝试重新启动模拟器(多次)和删除应用程序,并做一个完全干净的重建,但没有运气。在模拟器运行时,我还通过监视器检查了我的cpu使用情况,我只使用了大约30%的cpu和40%的内存。

我完全理解模拟器从来没有设备本身那么快,但它在这么长时间后突然开始变慢,这似乎很奇怪,我所说的慢是指不到原始速度的四分之一。


当前回答

React-Native用户的另一个潜在修复:

Chrome取消Javascript在任何标签中运行的优先级,而不是在前台。因此,如果启用了远程调试,请确保将调试器放在自己的窗口中。

其他回答

您可以尝试关闭远程调试(Cmd-D ->停止远程JS调试)。这通常会加快速度。

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.

所以,谢谢大家!

我认为你错误地按了command + T而不是command + R。

当chrome调试是活动的,浏览器选项卡不在前台,模拟器也很慢。对我来说,我决定把指南放在前台。

进入模拟器菜单 Device ->重启

然后一切都比你想象的快-_-