Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running playground. Unable to find suitable target device

I downloaded the Swift languages's 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 the error message:

Error running playground.
Unable to find suitable target device.

I click OK button to close the error message window, get back to the playground with the title "A Swift Tour". There is no output for any of the embedded code there. And every time I try to edit any of the code, the error message will pop up again and again.

Some people on the web had the same problem and solved it by adding some devices under the menu Window -> Devices -> SIMULATORS. I did it, but the error keeps showing.

If I click File -> New -> Playground to create a testing playground, this error message will not appear, and the testing code will run.

A week ago, I had replaced the HDD in my Early 2008 iMac with a SSD (solid state disk), recovered the whole system to the SSD from my Time Machine backup. Everything looks good until I found out that Xcode begins to refuse to run the tutorial "A Swift Tour". Before the SSD replacement, Xcode would run it. This might be related?

like image 346
AlvaPan Avatar asked Jan 23 '15 06:01

AlvaPan


2 Answers

Thanks a lot for Raptor's kind response. I have solved this problem. I found out that I just added not enough simulators so that Xcode was unable to find suitable target device. After I added all the 10 simulators for iOS 8.1, the error is gone and the output appears.

At first, it seems that I will have to add all of them to make it work. Then after quite a few experiments by removing and adding some back and forth and restarting xcode, I cannot make sure exactly how many simulators are needed. Maybe 3 or 4.

like image 83
AlvaPan Avatar answered Dec 02 '22 20:12

AlvaPan


playgrounds will run fine, assuming at least one of the following simulators are configured: iPhone 6, iPhone 6+, iPad Air, resizable iPhone, or resizable iPad.

like image 32
Robin Avatar answered Dec 02 '22 20:12

Robin