本文介绍了iOS/tvOS playground 失败,并显示“无法找到所选运行目标的执行服务";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

迁移到 XCode 7.1 后,我无法在 iOS 和 tvOS 平台上使用 Playground.只有 OS X 有效.最简单的操场代码产生错误信息:

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 找不到合适的模拟器有关,但是我不知道在哪里以及如何配置它.

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

我在现有项目中尝试过 Playground,以及刚从启动画面中新创建的一个.

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

有什么想法可能出问题了吗?

Any ideas what might be wrong?

更新:

检查控制台可以提供更多信息,但仍然不清楚如何修复:

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

推荐答案

好的,经过一番挣扎,这里是解决方案.

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

  1. 清理文件夹~/Library/Developer/CoreSimulator
  2. 重启机器
  3. 尝试运行 iOS Playground,它现在应该可以正常工作了.

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

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

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

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.

这篇关于iOS/tvOS playground 失败,并显示“无法找到所选运行目标的执行服务";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 22:55