ios Xcode Simulator 动画在编辑器中播放时非常慢
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31378232/
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
Xcode Simulator animations extremely slow when played in editor
提问by kjoelbro
Recently I have experienced, that Xcode's simulator has become extremely slow. Also if I create a new app and run it i, the transition between the launch screen and the first view controller takes about 3 seconds. Luckily it is only the iOS 9 simulator and not iOS 8 or lower. I have upgraded to Xcode 6.4 and I also have Xcode 7.0 beta 3 installed. Has anyone experienced the same? I have tried to uninstall both Xcode versions, but it didn't help.
最近我体验到,Xcode 的模拟器变得非常慢。此外,如果我创建一个新应用程序并运行它,启动屏幕和第一个视图控制器之间的转换大约需要 3 秒。幸运的是,它只是 iOS 9 模拟器,而不是 iOS 8 或更低版本。我已升级到 Xcode 6.4,并且还安装了 Xcode 7.0 beta 3。有没有人经历过同样的事情?我试图卸载两个 Xcode 版本,但没有帮助。
回答by kjoelbro
If you press command+T it triggers the 'Slow animations' feature. I didn't noticed this setting until now. Doh!
如果您按 command+T,它会触发“慢速动画”功能。直到现在我才注意到这个设置。哦!
回答by Masih
In Simulator menu, go to Debug> Slow Animations, and uncheck this option or simply do:
在 Simulator 菜单中,转到Debug> Slow Animations,然后取消选中此选项或只需执行以下操作:
?+ T
?+ T
回答by Mike Keskinov
XCODE 9 BUG. This is officially confirmed to be an issue with Xcode 9.0 and its iOS 11 simulator — it affects any OpenGL-using application.
Xcode 9 错误。官方确认这是 Xcode 9.0 及其 iOS 11 模拟器的问题——它会影响任何使用 OpenGL 的应用程序。
See: https://github.com/mapbox/mapbox-gl-native/issues/9959
参见:https: //github.com/mapbox/mapbox-gl-native/issues/9959
Also: https://twitter.com/xenadu02/status/911463433521860609
另外:https: //twitter.com/xenadu02/status/911463433521860609
:( Hope this helps.
:( 希望这可以帮助。
回答by Karbaman
Currently only iOS11 simulator is slow.
目前只有 iOS11 模拟器很慢。
You can download additional iOS10 simulator which works perfectly.
您可以下载额外的 iOS10 模拟器,它可以完美运行。
Choose Xcode -> Product -> Destination -> Download simulators... Then select any iOS10 simulator from the list (e.g. 10.3.1).
选择 Xcode -> Product -> Destination -> Download Simulators... 然后从列表中选择任何 iOS10 模拟器(例如 10.3.1)。
After that you will choose iOS version for most devices:
之后,您将为大多数设备选择 iOS 版本:
回答by Suresh Kansujiya
It's known bug by apple developer see below link https://forums.developer.apple.com/thread/83570
这是苹果开发人员已知的错误,请参阅以下链接 https://forums.developer.apple.com/thread/83570
回答by Alex Barti?
This has been fixed in Xcode 9.1 beta 2
这已在 Xcode 9.1 beta 2 中修复
Fixed an issue in Simulator's OpenGL that could cause SceneKit apps to run slowly and the CPU to hit 100% when attempting to pan in an MKMapView.
修复了模拟器的 OpenGL 中的一个问题,该问题可能导致 SceneKit 应用程序在尝试平移 MKMapView 时运行缓慢并且 CPU 达到 100%。
回答by mikep
Xcode simulator has extremely low performance. It is Apple's bug. I have reported it via Feedback Assistant. I have created demo with code demonstrating that simulator is 200 times slower than any old real device. I have found that JavaScript code with Date object executed in WKWebView is pain for simulator. See jsfiddle https://jsfiddle.net/kjms16cw/
Xcode 模拟器的性能极低。这是苹果的bug。我已经通过反馈助手报告了它。我用代码创建了演示,演示模拟器比任何旧的真实设备慢 200 倍。我发现在 WKWebView 中执行带有 Date 对象的 JavaScript 代码对于模拟器来说很痛苦。见 jsfiddle https://jsfiddle.net/kjms16cw/
var log = document.getElementById("log");
document.getElementById("button").onclick = function() { run(); };
function run() {
var d1 = new Date();
for (var i = 0; i < 1000; i++) {
var x = new Date();
x.setMilliseconds(0);
x.setSeconds(0);
x.setMinutes(0);
}
var d2 = new Date();
log.innerHTML = ((d2.getTime() - d1.getTime()) / 1000) + " seconds";
}
<h3>Xcode Simulator Extremely Low Performance</h3>
<p>This test runs fast (several tens milliseconds e.g. 30 ms)
in any browser any device any platform including very old iOS device
e.g. iPhone 5C and several years old iPad 2, BUT IN SIMULATOR IT TAKES 6000 ms
(yes, 6 seconds!). Terrible!</p>
<button id="button">run()</button>
<div id="log"></div>
回答by Benjamin Lowry
I had this same problem, and after scratching my head for a while, I realized that having the Xcode "Organizer" window open while running the Simulator causes it to behave very slowly. So for anyone who doesn't have the "slow animations" option ticked, check that the Organizer window isn't open.
我遇到了同样的问题,在摸索了一段时间后,我意识到在运行模拟器时打开 Xcode“Organizer”窗口会导致它的行为非常缓慢。因此,对于没有勾选“慢速动画”选项的任何人,请检查管理器窗口是否未打开。
回答by Sean Conrad
I believe this is an issue with El Capitan, not necessarily Xcode 7 or iOS 9. https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0/index.html
我相信这是 El Capitan 的问题,不一定是 Xcode 7 或 iOS 9。https ://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0/index.html