简体   繁体   English

ios模拟器在xcode 6中显示为UDID

[英]ios simulator appear with UDID in xcode 6

When i select simulator from xcode 6 then i'm getting multiple option to select simulator but simulator comes with UDID. 当我从xcode 6中选择模拟器时,我得到多个选项来选择模拟器,但模拟器带有UDID。 Please see the below image and please help me out. 请看下面的图片,请帮帮我。 Thanks in advance. 提前致谢。

在此输入图像描述

killall Xcode
- Kills all running Xcode processes. - 杀死所有正在运行的Xcode进程。
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
- Kills all running CoreSimulatorService's processes. - 杀死所有正在运行的CoreSimulatorService进程。
rm -rf ~/Library/Developer/CoreSimulator/Devices
- Removes all Simulator data, from all the Simulators. - 从所有模拟器中删除所有模拟器数据。
open /Applications/Xcode.app - Opens Xcode. - 打开Xcode。

The above steps from xcode 10 are invalid, please use the following steps: 从xcode 10开始的上述步骤无效,请使用以下步骤:

xcrun simctl shutdown all
shutdown all devices 关闭所有设备

xcrun simctl list devices|grep -v "unavailable"|grep -Eo "[0-9A-F\\-]{36}"
list all available devices 列出所有可用设备

xcrun simctl list devices|grep -v "unavailable"|grep -Eo "[0-9A-F\\-]{36}"|xargs xcrun simctl delete delete all devices(note: this is a single line) xcrun simctl list devices|grep -v "unavailable"|grep -Eo "[0-9A-F\\-]{36}"|xargs xcrun simctl delete删除所有设备(注意:这是一行)

more detail xcrun simctl help 更多细节xcrun simctl help

In Xcode, go to Window -> Devices (shortcut is Cmd+!) 在Xcode中,转到Window - > Devices(快捷方式是Cmd +!)

In the left pane, delete all the superfluous simulator devices (select in the left pane and press delete on keyboard) 在左侧窗格中,删除所有多余的模拟器设备(在左侧窗格中选择并按键盘上的删除)

Usually these are the ones that have no OS (showing iOS: n/a). 通常这些是没有操作系统的(显示iOS:不适用)。

This usually happens when you try and copy older simulator versions directly in the SDK folders rather than installing them from Xcode -> Preferences. 当您尝试直接在SDK文件夹中复制较旧的模拟器版本而不是从Xcode - > Preferences安装它们时,通常会发生这种情况。

How to fix it 如何解决它

Xcode uses the device version to disambiguate devices with the same name. Xcode使用设备版本来消除具有相同名称的设备的歧义。 If two devices have the same name and version number, it will use the devices' UDIDs. 如果两个设备具有相同的名称和版本号,则它将使用设备的UDID。

You have 4 of each of a bunch of devices (eg iPhone 5s). 你有一堆设备中的每一个(例如iPhone 5s)。 I suspect that some of them are for the same iOS version. 我怀疑其中一些是针对相同的iOS版本。 You should delete some of the duplicates. 您应该删除一些重复项。 Check out xcrun simctl list and xcrun simctl delete or use the device manager within Xcode.app (click on the "-" to delete a device). 查看xcrun simctl listxcrun simctl delete或使用xcrun simctl delete的设备管理器(单击“ - ”删除设备)。

How to just get back to a default state 如何回到默认状态

# Ensure all possible clients of CoreSimulatorService are no longer running:

killall Xcode 2> /dev/null
killall Instruments 2> /dev/null
killall 'iOS Simulator' 2> /dev/null
killall Simulator 2> /dev/null
killall 'Simulator (Watch)' 2> /dev/null
killall ibtoold 2> /dev/null
killall simctl 2> /dev/null
# There may be others

# Kill the service itself
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

# Remove all the data and logs
rm -rf ~/Library/*/CoreSimulator

Why this might be happening: 为什么会发生这种情况:

CoreSimulatorService will monitor for the addition of new simulator runtimes in /Library/Developer/CoreSimulator/Profiles (eg, for when downloading them from Xcode -> Preferences -> Downloads). CoreSimulatorService将监视在/ Library / Developer / CoreSimulator / Profiles中添加新的模拟器运行时(例如,从Xcode下载它们时 - >首选项 - >下载)。 When installing a new runtime, CoreSimulatorService will create an initial set of devices for that runtime. 安装新运行时时,CoreSimulatorService将为该运行时创建一组初始设备。

This problem arrises if there are multiple instances of CoreSimulatorService running at the same time. 如果同时运行多个CoreSimulatorService实例,则会出现此问题。 Each CoreSimulatorService instance will create its own set of devices (but its clients will only see that instances's sets at first). 每个CoreSimulatorService实例都将创建自己的一组设备(但其客户端最初只会看到该实例的设置)。 On subsequent launches (eg: after a reboot), both copies will be seen. 在后续启动时(例如:重启后),将看到两个副本。 One can get into a state where multiple copies of CoreSimulatorService are running at the same time due to testing beta versions of Xcode.app in the same login session as using the released Xcode.app or by having used Xcode.app before and after updating it through the App Store. 由于在与使用发布的Xcode.app相同的登录会话中测试Xcode.app的beta版本或者在更新之前和之后使用Xcode.app,可以进入同时运行多个CoreSimulatorService副本的状态通过App Store。

If you are aware of any other way that this bug might come about, please file a new radar at http://bugreport.apple.com 如果您了解此错误可能产生的任何其他方式,请在http://bugreport.apple.com上提交新的雷达

As @ameer-sheikh mentioned, go to Window > Devices You likely have multiple devices with the same iOS version. 正如@ ameer-sheikh所提到的,请转到Window> Devices您可能拥有多个具有相同iOS版本的设备。 I had the same issue, and after selecting each duplicate device and pressing delete I was able to restore order to my Devices dropdown 我有同样的问题,在选择每个重复设备并按下删除后,我能够将订单恢复到我的设备下拉列表

Go to Window -> Devices (Shortcut is Cmd+Shift+2) In the left pane, delete all the superfluous simulator devices (select in the left pane and press delete on keyboard) Usually these are the ones that have no OS (showing iOS: n/a). 转到窗口 - >设备(快捷方式是Cmd + Shift + 2)在左侧窗格中,删除所有多余的模拟器设备(在左窗格中选择并按键盘上的删除)通常这些是没有操作系统的设备(显示iOS) :不适用)。 This usually happens when you try and copy older simulator versions directly in the SDK folders rather than installing them from Xcode -> Preferences. 当您尝试直接在SDK文件夹中复制较旧的模拟器版本而不是从Xcode - > Preferences安装它们时,通常会发生这种情况。

The bash commands in another answer are probably simpler but you can try this for an easier yet more complex solution: 另一个答案中的bash命令可能更简单,但您可以尝试更简单,更复杂的解决方案:

gem install snapshot; snapshot reset_simulators

https://github.com/KrauseFx/snapshot https://github.com/KrauseFx/snapshot

via @saniul 通过@saniul

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

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