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

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

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


当前回答

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

其他回答

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

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

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

模拟器->重置内容和设置为我工作。当我远程调试我的反应本机代码时,这个问题似乎又出现了。也可以像nomad建议的那样使用AsyncStorage。

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。