iOS/tvOS游乐场失败,“无法为选定的运行目的地找到执行服务”

时间:2023-01-23 19:03:11

After migrating to XCode 7.1 I can not use playground with iOS and tvOS platforms. Only OS X works. Simplest playground code produces error message:

迁移到XCode 7.1后,我无法使用iOS和tvOS平台的游乐场。OS X的作品。最简单的操场代码产生错误消息:

Unable to find execution service for selected run destination

无法为选定的运行目的地找到执行服务

I suspect it has to do with XCode not finding the right simulator, however I have no idea where and how to configure it.

我怀疑这与XCode没有找到合适的模拟器有关,但是我不知道在哪里以及如何配置它。

I tried playground in the existing project, as well as just newly created one from the splash screen.

我在已有的项目中尝试了游乐场,也尝试了从启动屏幕中新建一个。

Any ideas what might be wrong?

有什么问题吗?

UPDATE:

更新:

Checking console gives a bit more insight, but still not clear how to fix:

检查控制台提供了更多的见解,但仍然不清楚如何修复:

24/10/2015 10:16:10,193 lsd[279]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
24/10/2015 10:16:10,212 com.apple.usbmuxd[82]: LOCKDOWN_V2_BONJOUR_SERVICE_NAME is _apple-mobdev2._tcp,8de107c0
24/10/2015 10:16:10,248 Xcode[819]:  DeveloperPortal: Using pre-existing current store at URL (file:///Users/courteouselk/Library/Developer/Xcode/DeveloperPortal%207.1.db).
24/10/2015 10:16:10,381 com.apple.CoreSimulator.CoreSimulatorService[461]: Requested phone is is not available for pairing.  Assuming it has the capability.
24/10/2015 10:16:10,384 com.apple.CoreSimulator.CoreSimulatorService[461]: Requested phone is is not available for pairing.  Assuming it has the capability.
24/10/2015 10:16:12,929 com.apple.usbmuxd[82]: _SendAttachNotification Device 80:ea:96:04:a5:da@fe80::82ea:96ff:fe04:a5da._apple-mobdev2._tcp.local. has already appeared on interface 4. Suppressing duplicate attach notification.
24/10/2015 10:16:13,311 GPUToolsAgent[832]: Mac Agent inited !!!
24/10/2015 10:16:14,287 Xcode[819]: <DYMobileDevice: 0x7ffbfd6b6320>: failed to acquire service transport reservation: Error Domain=DYAMDErrorDomain Code=-402653150 "(null)"
24/10/2015 10:16:14,447 Xcode[819]: [MT] IDEPlaygroundEditor: Error encountered attempting to run playground: Error Domain=IDEPlaygroundErrorDomain Code=1 "Unable to find execution service for selected run destination." UserInfo={NSLocalizedDescription=Unable to find execution service for selected run destination.}
24/10/2015 10:16:19,672 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,672 mdworker[255]: LaunchServices: Database mapping failed with result -10822, retrying
24/10/2015 10:16:19,672 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,673 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,673 mdworker[255]: LaunchServices: Database mapping failed with result -10822, retrying
24/10/2015 10:16:19,673 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,674 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,674 mdworker[255]: LaunchServices: Database mapping failed with result -10822, retrying
24/10/2015 10:16:19,674 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,674 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:19,674 mdworker[255]: LaunchServices: Database mapping failed with result -10822, retrying
24/10/2015 10:16:19,675 mdworker[255]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
24/10/2015 10:16:20,497 Xcode[819]: CompanionProxy: _SocketReadCallback:128 (0x0x700000117000): Failed to receive response from AMDevice 0x7ffbfe60cad0 {UDID = e4bfce5e11be0bcf730ada45b4d6ae81f1abdb01, device ID = 23, FullServiceName = 80:ea:96:04:a5:da@fe80::82ea:96ff:fe04:a5da._apple-mobdev2._tcp.local.}: 0xe8000084
24/10/2015 10:16:20,497 Xcode[819]: CompanionProxy: _SocketReadCallback:200 (0x0x700000117000): Stopped listening for paired devices from AMDevice 0x7ffbfe60cad0 {UDID = e4bfce5e11be0bcf730ada45b4d6ae81f1abdb01, device ID = 23, FullServiceName = 80:ea:96:04:a5:da@fe80::82ea:96ff:fe04:a5da._apple-mobdev2._tcp.local.}: 0xe8000084

6 个解决方案

#1


69  

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.

在Xcode中,检查你的设备中是否有iPad Pro模拟器。如果没有,添加它通过添加模拟器选项。

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

正如一些人在评论中指出的,您可能还需要重新启动Xcode或重新打开游乐场。

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".

要添加模拟器,请转到设备(窗口>设备)。点击窗口左下角的+按钮,点击“添加模拟器”,从下拉菜单中选择合适的“设备类型”,点击“创建”。

#2


21  

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

经过一番挣扎,这就是解决办法。

  1. Clean up the folder ~/Library/Developer/CoreSimulator
  2. 清理文件夹~/Library/Developer/CoreSimulator。
  3. Restart the machine
  4. 重新启动机器
  5. Try running an iOS Playground, it should work without problems now.
  6. 试着在iOS平台上运行,现在应该没问题了。

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).

注意:在我的例子中,我将CoreSimulator重新命名为CoreSimulator。旧的,重新启动后,一个新的CoreSimulator被自动创建(所以,我把。old的扔掉了)。

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.

顺便说一句,有一个文件~/Library/Developer/CoreSimulator/Devices/device_set。在/Root/DefaultDevices下有完整的模拟器列表。我认为这就是问题的根源。

#3


20  

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

#4


2  

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

删除德里维数据文件夹中的所有内容,~/Library/Developer/Xcode/DerivedData,然后重新启动Xcode

#5


0  

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

添加xcode中的所有模拟器——>窗口——>设备。

and restart the xcode it will works fine

并重新启动xcode,它将正常工作

#6


0  

Xcode 8 update. Ran into a similar message

Xcode 8更新。遇到了类似的消息

"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.

然后在操场设置弹出它可能设置为未知。把它改成你选择的平台(我用的是OS X),然后你就可以开始了。

#1


69  

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.

在Xcode中,检查你的设备中是否有iPad Pro模拟器。如果没有,添加它通过添加模拟器选项。

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

正如一些人在评论中指出的,您可能还需要重新启动Xcode或重新打开游乐场。

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".

要添加模拟器,请转到设备(窗口>设备)。点击窗口左下角的+按钮,点击“添加模拟器”,从下拉菜单中选择合适的“设备类型”,点击“创建”。

#2


21  

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

经过一番挣扎,这就是解决办法。

  1. Clean up the folder ~/Library/Developer/CoreSimulator
  2. 清理文件夹~/Library/Developer/CoreSimulator。
  3. Restart the machine
  4. 重新启动机器
  5. Try running an iOS Playground, it should work without problems now.
  6. 试着在iOS平台上运行,现在应该没问题了。

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).

注意:在我的例子中,我将CoreSimulator重新命名为CoreSimulator。旧的,重新启动后,一个新的CoreSimulator被自动创建(所以,我把。old的扔掉了)。

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.

顺便说一句,有一个文件~/Library/Developer/CoreSimulator/Devices/device_set。在/Root/DefaultDevices下有完整的模拟器列表。我认为这就是问题的根源。

#3


20  

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

#4


2  

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

删除德里维数据文件夹中的所有内容,~/Library/Developer/Xcode/DerivedData,然后重新启动Xcode

#5


0  

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

添加xcode中的所有模拟器——>窗口——>设备。

and restart the xcode it will works fine

并重新启动xcode,它将正常工作

#6


0  

Xcode 8 update. Ran into a similar message

Xcode 8更新。遇到了类似的消息

"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.

然后在操场设置弹出它可能设置为未知。把它改成你选择的平台(我用的是OS X),然后你就可以开始了。