iOS Simulator花费极长的时间才能首次启动 [英] iOS Simulator takes extremely long time to boot first time

查看:224
本文介绍了iOS Simulator花费极长的时间才能首次启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行iOS模拟器(Xcode 7.0.1,OS X Yosemite).但是,我第一次运行模拟器时,启动时间很长(80-120秒),这导致我的自动化测试超时.如果我关闭模拟器并重新启动相同的模拟器,它将在5到8秒钟内启动.启动其他设备将再次导致启动时间过长.

I'm trying to run an iOS simulator (Xcode 7.0.1, OS X Yosemite). However, the first time I run the simulator, it takes a very long time to boot up (80-120 seconds), which is causing my automation testing to time out. If I close the simulator and re-launch the same one, it will boot up in about 5-8 seconds. Launching a different device will cause the long boot up time again.

我尝试重置模拟器的内容和设置,删除并重新下载模拟器,以及卸载并重新安装Xcode.

I have tried resetting the content and settings of the simulator, deleting and re-downloading simulators, and uninstalling and reinstalling Xcode.

该计算机是在2012 Mac Mini上运行的Parallels Desktop VM.虽然我不认为这是资源问题(模拟器在第二次启动时运行正常),但我曾尝试向虚拟机增加ram和视频内存,但没有成功.

This machine is a Parallels Desktop VM running on a 2012 Mac Mini. While I do not believe this to be a resource issue (the simulator runs just fine with the second launch), I have tried increasing ram and video memory to the VM with no success.

推荐答案

到目前为止,我的解决方案是在需要进行自动化之前预先启动模拟器.我认为这有点骇人听闻,但确实可以完成工作.

My solution so far has been to pre-boot the Simulator prior to needing it for automation. I consider this somewhat hackish, but it does get the job done.

xcrun instruments -w "Simulator Name Here"
sleep 120

这将启动模拟器,然后睡眠几分钟,然后继续进行模拟器所需的其他操作.

This will launch the simulator, then sleep for a couple minutes before proceeding on to whatever else you need the simulator for.

这篇关于iOS Simulator花费极长的时间才能首次启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆