Xcode 9.0 模拟器“消失了”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46259983/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:14:30  来源:igfitidea点击:

Xcode 9.0 simulators "disappeared"

iosxcodeios-simulator

提问by Adrian

I recently installed Xcode 9.0 GM on my machine. I fired it up to play around and the only simulators I see in the scheme are iPhone 8, iPHone 8 Plus, and iPhone X. I clicked "Download Additional Simulators" thinking the solution would lie there.

我最近在我的机器上安装了 Xcode 9.0 GM。我启动了它来玩,我在方案中看到的唯一模拟器是 iPhone 8、iPHone 8 Plus 和 iPhone X。我点击了“下载其他模拟器”,认为解决方案就在那里。

enter image description here

在此处输入图片说明

I'm greeted with this screen, which is everything I previously had installed.

我看到了这个屏幕,这是我以前安装的所有东西。

enter image description here

在此处输入图片说明

I dug around on the Apple Developer forum and found this postdiscussing a similar problem with a prior version of iOS. At the suggestion of one of the posters, I powered down my machine and booted it cold. I opened up Xcode 9.0 again and I have the same issue.

我在 Apple Developer 论坛上翻了翻,发现这篇文章讨论了与之前版本的 iOS 类似的问题。在其中一位海报的建议下,我关闭了我的机器并冷启动了它。我再次打开 Xcode 9.0,我遇到了同样的问题。

Any suggestions what I can get additional hardware to appear in my Xcode scheme? Thank you for reading.

有什么建议可以让额外的硬件出现在我的 Xcode 方案中吗?感谢您的阅读。

回答by Esben von Buchwald

In Xcode 10.3, I also lost all simulators but got them back by running

在 Xcode 10.3 中,我也丢失了所有模拟器,但通过运行将它们找回了

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

回答by Hudson

In case anyone else gets here and are in my situation, I just upgraded to Xcode 9.2 and the simulators were all missing, but quitting and relaunching Xcode restored them.

如果其他人来到这里并处于我的情况,我刚刚升级到 Xcode 9.2 并且模拟器都丢失了,但是退出并重新启动 Xcode 恢复了它们。

回答by tania_S

For me quitting and relaunching Xcode also didn't help. So I did the following 3 steps.

对我来说,退出并重新启动 Xcode 也无济于事。所以我做了以下3个步骤。

Three steps

三步走

Step 1:

第1步:

Product -> Destination -> Download Simulators... Download the simulator(s) you need

产品 -> 目的地 -> 下载模拟器... 下载您需要的模拟器

Step 2:

第2步:

Sometimes when you download the new simulator types, they don't automatically show in the list of possible simulators.

有时,当您下载新的模拟器类型时,它们不会自动显示在可能的模拟器列表中。

Product -> Destination -> Add Additional Simulators... Click the + button in the lower left hand corner, then Add Simulator Give it a name, device type, and the iOS version you just downloaded.

Product -> Destination -> Add Additional Simulators... 单击左下角的 + 按钮,然后 Add Simulator 给它一个名称、设备类型和您刚刚下载的 iOS 版本。

Step 3:

第 3 步:

Set proper deployment target. If you have downloaded simulators of lower versions, set the deployment target to the same.

设置适当的部署目标。如果您下载了低版本的模拟器,请将部署目标设置为相同。

Now it should show up in your list of simulator devices!

现在它应该显示在您的模拟器设备列表中!

回答by matt

Delete every single one of the simulators listed in the Devices and Simulators window, one by one, and then start over make new simulators. That always works for me. It's a good idea after anyupgrade, in fact.

删除设备和模拟器窗口中列出的每一个模拟器,然后重新开始制作新的模拟器。那总是对我有用。事实上,在任何升级之后,这是一个好主意。

回答by Adrian

My question was originally answered, but I found a more efficient way to do it with fastlane. Within fastlane, there's a tool called snapshot. The usage is as follows from terminal:

我的问题最初得到了回​​答,但我找到了一种使用fastlane更有效的方法。在 中fastlane,有一个名为snapshot的工具。终端的用法如下:

fastlane snapshot reset_simulators

fastlane snapshot reset_simulators

Warning: This will delete all your simulators and replace by new ones! This is useful, if you run into weird problems when running snapshot.

警告:这将删除您所有的模拟器并替换为新的!如果在运行快照时遇到奇怪的问题,这很有用。