xcode 运行操场时出错。无法找到合适的目标设备。(iOS Swift)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27939210/
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
Error running playground. Unable to find suitable target device. (iOS Swift)
提问by HDdeveloper
I created a new project in XCode.
我在 XCode 中创建了一个新项目。
File > New > Playground (option+shift+cmd+N)
文件 > 新建 > 操场(option+shift+cmd+N)
I restarted my XCode and also rebooted my system, but still same error.
我重新启动了我的 XCode 并重新启动了我的系统,但仍然是同样的错误。
采纳答案by Mayank Gupta
Try navigating to the Xcode Menu Window >> devices (shift+cmd+2) a new window will pop up.
尝试导航到 Xcode Menu Window >> devices (shift+cmd+2) 将弹出一个新窗口。
On the bottom left, add a new simulator, specifically one running on iOS 8.0 to the existing list.
在左下角,将一个新的模拟器,特别是在 iOS 8.0 上运行的模拟器添加到现有列表中。
Restart Xcode.
重新启动Xcode。
回答by Aaron Brager
From the developer forums, this worked for me:
从开发者论坛,这对我有用:
- Quit Xcode
- Delete the folder
/Users/<username>/Library/Developer/CoreSimulator/Devices
. For example, in Terminal:rm -rf ~/Library/Developer/CoreSimulator/Devices
- In Terminal:
killall -9 com.apple.CoreSimulator.CoreSimulatorService
(or just reboot).
- 退出 Xcode
- 删除文件夹
/Users/<username>/Library/Developer/CoreSimulator/Devices
。例如,在终端中:rm -rf ~/Library/Developer/CoreSimulator/Devices
- 在终端:(
killall -9 com.apple.CoreSimulator.CoreSimulatorService
或只是重新启动)。
回答by Nick Snyder
Fox Xcode 7, I had to install iPad Air or iPad Air 2 for the playground to work.
Fox Xcode 7,我必须安装 iPad Air 或 iPad Air 2 才能在操场上工作。
回答by Dren
Another possible way to encounter that issue is to get Xcode being auto-updated, while the simulator was launched.
遇到该问题的另一种可能方法是在模拟器启动时自动更新 Xcode。
The solution is like mentioned above but more polite:
解决方案如上所述,但更礼貌:
- Quit Xcode and Simulator app
- Run in Terminal: killall -9 com.apple.CoreSimulator.CoreSimulatorService
- Launch Xcode and find that all fixed now.
- 退出 Xcode 和模拟器应用
- 在终端运行:killall -9 com.apple.CoreSimulator.CoreSimulatorService
- 启动 Xcode,现在发现所有问题都已修复。
Sure, you can just reboot instead.
当然,您可以改为重新启动。
回答by HDdeveloper
As referred by @Mayank Gupta , It worked on adding new simulator and restarting the XCode.
正如@Mayank Gupta 所提到的,它致力于添加新的模拟器并重新启动 XCode。