Xcode 6.4 显示具有唯一 ID 的重复“模拟器”

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

Xcode 6.4 showing duplicate 'Simulators' with Unique Id

xcodeios8xcode6ios-simulatorsimulator

提问by itsji10dra

Till yesterday, everything was normal with Xcode. It was showing simulators as :

直到昨天,Xcode 一切正常。它显示模拟器为:

enter image description here

在此处输入图片说明

But today, when I opened it, simulator list changed to :

但是今天,当我打开它时,模拟器列表变为:

enter image description here

在此处输入图片说明

Every simulator can be seen twice, name followed by a unique id. I have also observed that same named Simulator are also two different instances.

每个模拟器都可以看到两次,名称后跟一个唯一的 ID。我还观察到同名模拟器也是两个不同的实例。

Can anyone help me, how to get rid of this ? Or how to reset it. It gives a weird look.

谁能帮我,如何摆脱这个?或者怎么重置。它给人一种奇怪的外观。

Any suggestion will be helpful.

任何建议都会有所帮助。

采纳答案by Doz

I have an easier way to fix this.

我有一个更简单的方法来解决这个问题。

Run the following:

运行以下命令:

xcrun simctl list devices | grep -v '^[-=]' | cut -d "(" -f2 | cut -d ")" -f1 | xargs -I {} xcrun simctl delete "{}"

回答by NSDeveloper

Solution from sunnyxx's weibo:

来自sunnyxx微博的解决方案:

1.quit Xcode and iOS Simulator

1.退出Xcode和iOS模拟器

2.killall -9 com.apple.CoreSimulator.CoreSimulatorService

2.killall -9 com.apple.CoreSimulator.CoreSimulatorService

3.rm -rf ~/Library/Developer/CoreSimulator/Devices

3.rm -rf ~/Library/Developer/CoreSimulator/Devices

4.reopen Xcode

4.重新打开Xcode

Edit: sudoseems unnecessary to kill SimulatorService.This solution will remove all exist simulator and recreate all available version and type simulators.

编辑:sudo似乎没有必要杀死 SimulatorService。此解决方案将删除所有现有的模拟器并重新创建所有可用的版本和类型模拟器。

回答by Kirualex

You can use the following command :

您可以使用以下命令:

snapshot reset_simulators

snapshot reset_simulators

If you don't already have snapshot installed :

如果您还没有安装快照:

sudo gem install snapshot.

sudo gem install snapshot.

More info on snapshothere : https://github.com/krausefx/snapshot#installation

有关快照的更多信息:https: //github.com/krausefx/snapshot#installation

回答by ErickES7

Looks like a ton of simulators were split into separate devices when updating. So what it sounds like you'd like to do is reduce your list of output decides.

更新时,看起来大量模拟器被拆分为单独的设备。所以听起来你想做的是减少你的输出决定列表。

To view the list of simulators, on the menu bar, goto: Window > Devices. Here you will see all the simulators shown in your output list. There is no reason to not delete and start over by adding the simulators you want

要查看模拟器列表,请在菜单栏上,转到:Window > Devices。在这里,您将看到输出列表中显示的所有模拟器。没有理由不删除并通过添加您想要的模拟器重新开始

回答by tobiasdm

Go to the terminal to see the list of simulators using:

转到终端以查看模拟器列表,使用:

xcrun simctl list

Use the id's to delete the duplicates using:

使用 id 删除重复项:

xcrun simctl delete <ID>

E.g.

例如

xcrun simctl delete 4B645F13-D130-412D-8EB4-B49BE7E2D7DA

回答by Cherpak Evgeny

Fixed it by going into Menu->Window->Devices and removing the duplicates (if you see multiple simulators for iPhone 6 for example remove all but one).

通过进入 Menu->Window->Devices 并删除重复项来修复它(例如,如果您看到 iPhone 6 的多个模拟器,则删除除一个之外的所有模拟器)。

回答by Brad The App Guy

Doz's oneliner is good, but the part that extracts the UUID of them simulator fails on some iPad devices like 'iPad Pro (12.9 inch)' because they have parentheses in the name. I rewrote to use grep instead of cut to account for this:

Doz 的 oneliner 很好,但提取模拟器 UUID 的部分在某些 iPad 设备(如“iPad Pro(12.9 英寸)”)上失败,因为它们的名称中有括号。我重写为使用 grep 而不是 cut 来解决这个问题:

xcrun simctl list devices | grep -o '[A-F0-9]\{8\}-[A-F0-9]\{4\}-[A-F0-9]\{4\}-[A-F0-9]\{4\}-[A-F0-9]\{12\}' | xargs -I {} xcrun simctl delete "{}"

回答by José Manuel Sánchez

I ended up creating a script to remove Xcode simulator duplicates:

我最终创建了一个脚本来删除 Xcode 模拟器重复项:

https://gist.github.com/buscarini/6ec0ef1385f47fdbc505

https://gist.github.com/buscarini/6ec0ef1385f47fdbc505