When your playground doesn’t find the exact device it wants to simulate it gets cranky. When your playground gets cranky, it displays this error, which more or less tells you nothing about which run destination to install:
So what are you supposed to do?
The easiest solution is to hop into Xcode > Windows > Devices and add one of every kind of possible simulator so Xcode stops throwing fits. Quit and restart and Xcode loses that wild-eyed crazy look and playgrounds start behaving…better.
But say you’re of a parsimonious frame of mind. Imagine those extra simulators offend you with their patent lack of efficiency. Which simulated devices can you toss from Xcode?
- Well, if you’re going to do any Apple TV dev, don’t toss the Apple TV one.
- You don’t need a “simulator” for OS X dev. So you probably never got an error in the first place.
- But what about for general iOS development? Which one was right?
Easy way to find out: print(NSTemporaryDirectory())
. It will look something like this:
/Users/ericasadun/Library/Developer/XCPGDevices/9A03F9FE-79F4-4FEA-B180-AB0D454C9A61/data/Containers/Data/Application/004CC333-1E33-4E20-AFEC-A8A5B7778562/tmp/
Then hop into the XCPGDevices folder to the subfolder with that UUID, and open the property list.
{ UDID = "9A03F9FE-79F4-4FEA-B180-AB0D454C9A61"; deviceType = "com.apple.CoreSimulator.SimDeviceType.iPad-Pro"; name = "iPad Pro"; runtime = "com.apple.CoreSimulator.SimRuntime.iOS-9-2"; state = 3; }
Boom. This instantly told me that the one simulator I couldn’t toss for iOS playgrounds was the iPad Pro one.
There’s, of course, not a lot of harm in keeping a bunch of simulators around — and they can be extremely helpful to have on hand. But some deeply OCD part of me is now relieved that I know which simulator my playground is running on. I hope this will comfort some of you as well.
Comments are closed.