Error during the execution of the playground. Unable to find a suitable target device

I downloaded the Swided languages ​​GuidedTour.playground.zip file from

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html

Unzip it as GuidedTour.playground, open it in Xcode 6.1.1, then an error message will appear:

Error running playground. Unable to find suitable target device. 

I click OK to close the error message window. Return to the venue called "A Swift Tour". There is no way out for any inline code. And every time I try to edit some code, an error message appears again and again.

Some people on the Internet had the same problem and it was solved by adding some devices to the menu Window → Devices → SIMULATORS. I did this, but the error continues to show.

If I click File → New → Playground to create a test site, this error message will not appear and the test code will be run.

A week ago, I replaced the hard drive in my iMac in early 2008 with an SSD (Solid State Disk), restored the entire system to an SSD from my Time Machine backup. Everything looks good until I found out that Xcode is starting to refuse to run the tutorial "A Swift Tour". Before replacing the SSD, Xcode launched it. Could this be related?

+7
xcode swift ios-simulator swift-playground
source share
5 answers

Thank you very much for your reply like Raptor. I solved this problem. I found out that I just added not enough simulators so that Xcode could not find a suitable target device. After I added all 10 simulators for iOS 8.1, the error will disappear and the output will appear.

At first it seems to me that I have to add everything for it to work. Then, after several experiments, deleting and adding some back and forth and restarting xcode, I can not determine exactly how many simulators are needed. Maybe 3 or 4.

+6
source share

Playgrounds will work fine, assuming that at least one of the following simulators is configured: iPhone 6, iPhone 6+, iPad Air, resizable iPhone or resizable iPad.

+6
source share

In Xcode 7:

Step 1: Window > Devices > bottom left corner plus icon > add iPad Air or iPad Air 2.

Step 2: Exit and restart Xcode.

+4
source share

Delete the contents of ~ / Library / Developer / XCPGDevices (usually it contains a directory with a name that is the UDID of the simulated device)

+4
source share

I am using Xcode Version 6.0.1. I am restarting the Mac (just restarting Xcode did not help) and this problem is resolved.

Hope this helps.

+2
source share

All Articles