简体   繁体   English

Xcode 8模拟器极慢

[英]Xcode 8 simulator extremely slow

I am running Xcode 8 on macOS Sierra 10.12.2, and there seems to be a problem with running the simulator on my first "Hello World!" 我在macOS Sierra 10.12.2上运行Xcode 8,在我的第一个“Hello World!”上运行模拟器似乎有问题。 app (simulating iPhone 7 Plus). 应用程序(模拟iPhone 7 Plus)。 As you can see, I am very new at app development. 如您所见,我在应用程序开发方面非常新。

The simulator gets stuck at the loading bar with the Apple logo for about 10 to 15 minutes, and then gives me the message of "The operation couldn't be completed. (Mach error -308 - (ipc/mig) server died)". 模拟器卡在带有Apple徽标的加载栏上大约10到15分钟,然后给我一条消息“操作无法完成。(Mach error -308 - (ipc / mig)server death)” 。

I dug around the web and found solutions suggesting to go to Product > Clean in Xcode, also Simulator > Reset Content and Settings... in Simulator. 我在网上挖掘并发现解决方案建议转到Xcode中的产品>清洁,还有模拟器中的模拟器>重置内容和设置......

After which, the system gets stuck at the spinning clock for about 20 minutes and gives me the error message "Unable to contact local DTServiceHub to bless simulator connection" (solution I found online tells me to "Reset Content and Settings...") 之后,系统卡在旋转时钟大约20分钟,并给出错误消息“无法联系本地DTServiceHub以保证模拟器连接”(我在网上找到的解决方案告诉我“重置内容和设置...”)

I'm just really lost here because the error codes seems inconsistent in ways I cannot explain. 我真的迷失在这里,因为错误代码似乎与我无法解释的方式不一致。 Maybe it is my laptop? 也许这是我的笔记本电脑? (Early 2011 MacBook Pro 15" 4GB ram, 2.2GHz Corei7) (2011年初MacBook Pro 15“4GB内存,2.2GHz Corei7)

Thank you in advance for your effort to help me. 提前感谢您帮助我的努力。

On older/slower Macs the first run of an App on a simulator will be slow like this and an error often occurs: 在较旧/较慢的Mac上,在模拟器上第一次运行App会很慢,并且经常会出错:

The Apple logo bit is the simulator initialising (just like a real device when you cold start it) - just be patient and let it finish. Apple徽标位是模拟器初始化(就像你冷启动时的真实设备一样) - 只要耐心等待,让它完成。

The error I suspect is something in XCode timing out due to be excessive delay. 我怀疑的错误是由于过度延迟导致XCode超时。 If this happens don't clean, just re-run: the simulator should not need to re-initialise so everything should be quicker and on my slow Mac setup the error does not tend to re-occur (unless I shut down or close the simulator - in which case I have to wait for it to re-initialise again!) 如果发生这种情况不要清理,只需重新运行:模拟器不需要重新初始化所以一切都应该更快,在我的慢速Mac设置上,错误不会再发生(除非我关闭或关闭模拟器 - 在这种情况下,我必须等待它重新初始化!)

Helpfully you can manage without getting a new Mac :o) 帮助您无需购买新Mac即可管理:o)

I usually do this on Xcode 8.3.3. 我通常在Xcode 8.3.3上这样做。

  1. Uncheck Debug->Optimize Rendering for Window Scale 取消选中Debug-> Optimize Rendering for Window Scale
  2. Check again Debug->Optimize Rendering for Window Scale 再次检查Debug-> Optimize Rendering for Window Scale
  3. It will work now 它现在可以工作了

No Xcode simulator is not slow, It may be because slow animation is checked 没有Xcode模拟器不慢,可能是因为检查了慢动画

Select Simulator Debug Option and uncheck slow animation 选择模拟器调试选项并取消选中慢动画

That's work for me. 这对我有用。 Hope it works for you 希望这对你有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM