Error running playground. Unable to find suitable target device. (iOS Swift)

↘锁芯ラ 提交于 2019-11-29 07:07:40

问题


I created a new project in XCode.

File > New > Playground (option+shift+cmd+N)

I restarted my XCode and also rebooted my system, but still same error.


回答1:


Try navigating to the Xcode Menu Window >> devices (shift+cmd+2) a new window will pop up.

On the bottom left, add a new simulator, specifically one running on iOS 8.0 to the existing list.

Restart Xcode.




回答2:


From the developer forums, this worked for me:

  1. Quit Xcode
  2. Delete the folder /Users/<username>/Library/Developer/CoreSimulator/Devices. For example, in Terminal: rm -rf ~/Library/Developer/CoreSimulator/Devices
  3. In Terminal: killall -9 com.apple.CoreSimulator.CoreSimulatorService (or just reboot).



回答3:


Fox Xcode 7, I had to install iPad Air or iPad Air 2 for the playground to work.




回答4:


Another possible way to encounter that issue is to get Xcode being auto-updated, while the simulator was launched.

The solution is like mentioned above but more polite:

  1. Quit Xcode and Simulator app
  2. Run in Terminal: killall -9 com.apple.CoreSimulator.CoreSimulatorService
  3. Launch Xcode and find that all fixed now.

Sure, you can just reboot instead.




回答5:


As referred by @Mayank Gupta , It worked on adding new simulator and restarting the XCode.



来源:https://stackoverflow.com/questions/27939210/error-running-playground-unable-to-find-suitable-target-device-ios-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!