无法在 Xcode 中选择 iOS 模拟器

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

Can't select iOS simulator in Xcode

iosios-simulatorxcode6

提问by user123456

I updated Xcode to the 6.1 version and now I don't understand why I can't select the simulator in the top left corner like in the previous version when I want to run my application. The only choice that appear is a general "iOS device".

我将 Xcode 更新到 6.1 版本,现在我不明白为什么当我想运行我的应用程序时不能像以前的版本一样选择左上角的模拟器。出现的唯一选择是一般的“iOS 设备”。

采纳答案by user123456

I finally found the solution. When I added a simulator in the devices menu (Shift+Cmd+2) I got this error: "Unable to determine SimDeviceSet, set_path=/Users/MyUser/Library/Developer/CoreSimulator/Devices" I checked the directory and there was not the folder "CoreSimulator", so I created it. I restarted XCode and now there are all the iOS Simulators selectable for running my app.

我终于找到了解决方案。当我在设备菜单 (Shift+Cmd+2) 中添加模拟器时,我收到此错误:“无法确定 SimDeviceSet,set_path=/Users/MyUser/Library/Developer/CoreSimulator/Devices”我检查了目录,但没有文件夹“CoreSimulator”,所以我创建了它。我重新启动了 XCode,现在可以选择所有 iOS 模拟器来运行我的应用程序。

Thank you all.

谢谢你们。

回答by Erik

Press "Window" and then "Devices", check if they appear there and if not - click the "+" icon in the lower left

按“窗口”然后“设备”,检查它们是否出现在那里,如果没有 - 单击左下角的“+”图标

回答by Libran Coder

Go to File-> Project Settings-> Info. Change the deployment target to a lower or higher version.

转到文件->项目设置->信息。将部署目标更改为更低或更高版本。

Most probably you do not have a simulator installed for the current deployment target. You can do so by going to Xcode Preferences-> Downloads. In the Components section, you will see the options for downloading the simulators you already don't have.

很可能您没有为当前部署目标安装模拟器。您可以通过转到Xcode Preferences-> Downloads 来执行此操作。在组件部分,您将看到下载您还没有的模拟器的选项。

Faced the same issue many times and found this solution. Hope this helps. :)

多次遇到同样的问题并找到了这个解决方案。希望这可以帮助。:)

回答by Jeremy Huddleston Sequoia

I suspect that you are having issues communicating with CoreSimualtorService due to renaming Xcode.app or similar. This is mentioned in the Xcode 6.0 and 6.1 release notes. Unfortunately, the only workaround at the moment is for you to rename it back or reboot.

我怀疑由于重命名 Xcode.app 或类似名称,您在与 CoreSimualtorService 通信时遇到问题。这在 Xcode 6.0 和 6.1 发行说明中提到。不幸的是,目前唯一的解决方法是您将其重命名或重新启动。

Update:

更新

Note that for current (as of this update) versions of Xcode (7.2+), renaming should work ok. For best results, only use one version of Xcode at a time. If you start another version of Xcode while one is running, the previous one will loose access to simulator devices. Restarting it will cause it to have access to the simulator devices (and of course the other one to stop). Basically, the last one wins.

请注意,对于当前(截至本更新)版本的 Xcode (7.2+),重命名应该可以正常工作。为获得最佳效果,一次仅使用一个版本的 Xcode。如果您在运行时启动另一个版本的 Xcode,则前一个版本将无法访问模拟器设备。重新启动它将导致它可以访问模拟器设备(当然另一个停止)。基本上,最后一个获胜。

回答by MacDeveloper

I experienced same issue.My OS is 10.9.5. I solved this issue by downloading IOS simulator 7.1 from Xcode Preferences -> Downloads -> iOS 7.1 Simulator. And then Windows -> Devices -> added simulator devices by clicking +.

我遇到了同样的问题。我的操作系统是 10.9.5。我通过从 Xcode Preferences -> Downloads -> iOS 7.1 Simulator 下载 IOS 模拟器 7.1 解决了这个问题。然后 Windows -> Devices -> 通过单击 + 添加模拟器设备。

Thanks.

谢谢。

回答by Taranjeet Kaur

Go to Window -> Devices and Simulators, check whether there is any Simulator listed. If no, add by clicking over "-" over the lower left corner. Or if devices are there but you are not able to see them in devices to be choose from, then check for deployment target that might not be compatible with Xcode simulators, set target according to your Xcode support and you will see the simulators list.

转到窗口 -> 设备和模拟器,检查是否列出了任何模拟器。如果不是,请单击左下角的“-”进行添加。或者,如果设备在那里,但您无法在可供选择的设备中看到它们,则检查可能与 Xcode 模拟器不兼容的部署目标,根据您的 Xcode 支持设置目标,您将看到模拟器列表。

回答by u5969589

in my case, after delete xcuserdata from my folder, then simulate only have my mac without any other options. after search, I found in scheme setting, Run->Info->Executable without any app. Then I select my app in the project. then simulator all come back.

在我的情况下,从我的文件夹中删除 xcuserdata 后,然后模拟只有我的 mac 没有任何其他选项。经过搜索,我在scheme设置中找到了Run->Info->Executable,没有任何应用程序。然后我在项目中选择我的应用程序。然后模拟器都回来了。