iOS/tvOS playground fails with “Unable to find execution service for selected run destination”

落爺英雄遲暮 提交于 2019-12-03 22:18:48
Alexander Borisenko

There may be a faster solution:

Check that you have iPad Pro simulator in your devices in Xcode. If not – add it via Add Simulator option.

As some have noted in comments, you may also need to restart Xcode or reopen the playground.

To add a simulator go to Devices (Window > Devices). Click the + button at the far bottom left of the window, click "Add Simulator", then select the appropriate "Device Type" from the dropdown and click "Create".

Ok, after some struggle, here's the solution.

  1. Clean up the folder ~/Library/Developer/CoreSimulator
  2. Restart the machine
  3. Try running an iOS Playground, it should work without problems now.

Note: In my case I renamed CoreSimulator to CoreSimulator.old, and after restart a new CoreSimulator was auto-created (so, I just threw away the .old one).

BTW, there is a file ~/Library/Developer/CoreSimulator/Devices/device_set.plist with whole list of Simulators under /Root/DefaultDevices. I think this is where the problem was coming from.

I was able to resolve this issue with these two commands in the Terminal:

$ rm -rf ~/Library/Developer/CoreSimulator/Devices
$ killall -9 com.apple.CoreSimulator.CoreSimulatorService

Delete everything inside your DerivedData folder, ~/Library/Developer/Xcode/DerivedData, and then restart Xcode

Add all the simulators in xcode--> window-->devices.

and restart the xcode it will works fine

Xcode 8 update. Ran into a similar message

"selected platform is not available"

With the playground open, in the upper right of the window, the last icon on the right: Hide or Show the Utilities. Click that, then in that area click the icon on the left: Show File Inspector.

Then in the Playground Settings popup it may be set for unknown. Change it to your Platform of choice (OS X for me) then you should be good to go.

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