【问题标题】:Xcode 7 Invalid Device State - XPC_ERRORXcode 7 无效的设备状态 - XPC_ERROR
【发布时间】:2016-06-03 04:41:23
【问题描述】:

当我运行cordova emulate ios(或ionic emulate ios)时,我得到一个无效的设备状态错误代码=159。如果我让模拟器保持打开状态,重置内容,然后重新运行命令,我不会收到上述错误,但模拟器永远不会完成加载应用程序。

在这两种情况下,系统都会记录来自instrumentsmdworker 的数百个XPC_ERROR_CONNECTION_INTERRUPTED 条目。这是最近一次尝试的最后几篇:

Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: Database mapping failed with result -10822, retrying
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: Database mapping failed with result -10822, retrying
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: Database mapping failed with result -10822, retrying
Feb 21, 2016, 2:08:59 PM instruments[93351]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 21, 2016, 2:08:59 PM com.apple.xpc.launchd[1]: Caller not allowed to perform action: instruments.93351, action = service submission, code = 1: Operation not permitted, uid = 503, euid = 503, gid = 20, egid = 20, asid = 100007
Feb 21, 2016, 2:09:30 PM com.apple.CoreSimulator.CoreSimulatorService[549]: Error Domain=com.apple.CoreSimulator.SimError Code=159 "Unable to lookup in current state: Shutdown" UserInfo={NSLocalizedDescription=Unable to lookup in current state: Shutdown}
Feb 21, 2016, 2:09:30 PM com.apple.CoreSimulator.CoreSimulatorService[549]: Error Domain=com.apple.CoreSimulator.SimError Code=159 "Unable to lookup in current state: Shutdown" UserInfo={NSLocalizedDescription=Unable to lookup in current state: Shutdown}
Feb 21, 2016, 2:09:30 PM com.apple.CoreSimulator.CoreSimulatorService[549]: Error looking up host support port
Feb 21, 2016, 2:09:32 PM com.apple.CoreSimulator.CoreSimulatorService[549]: Error Domain=com.apple.CoreSimulator.SimError Code=159 "Unable to lookup in current state: Shutdown" UserInfo={NSLocalizedDescription=Unable to lookup in current state: Shutdown}
Feb 21, 2016, 2:09:32 PM com.apple.CoreSimulator.CoreSimulatorService[549]: Error Domain=com.apple.CoreSimulator.SimError Code=159 "Unable to lookup in current state: Shutdown" UserInfo={NSLocalizedDescription=Unable to lookup in current state: Shutdown}
Feb 21, 2016, 2:09:32 PM com.apple.CoreSimulator.CoreSimulatorService[549]: Error looking up host support port

我知道还有其他一些关于此的帖子,但似乎都没有解决我的问题。我在本地运行所有内容,权限在用户目录中正确配置。我已经在 Xcode 7.21 和 7.3 上重现了这个错误,使用防火墙和不使用防火墙,通过 nvm 和单独使用节点。

我当前的配置:

Cordova CLI: 6.0.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan 10.11.3
Node Version: v5.6.0
Xcode version: Xcode 7.3 Build version 7D141l

一些帖子表明这与 Time Machine 和 Spotlight 有关。我不知道,但如果有帮助 - 我目前没有使用 Time Machine,我已将整个 HD 放在 TM 的排除文件夹中。最后,通过研究下面的“无法存储”日志,我添加了/private/var/db/lsd 文件夹……但是它并没有解决问题。这可能无关,但我不确定。

Feb 21, 2016, 3:06:28 PM com.apple.xpc.launchd[1]: Service only ran for 1 seconds. Pushing respawn out by 9 seconds.
Feb 21, 2016, 3:06:29 PM com.apple.usbmuxd[94227]: stopping.
Feb 21, 2016, 3:06:30 PM com.apple.usbmuxd[16479]: log filter changed from 4 to 6
Feb 21, 2016, 3:06:30 PM com.apple.usbmuxd[16479]: usbmuxd-364 on Aug  4 2015 at 14:36:18, running 64 bit
Feb 21, 2016, 3:07:37 PM lsd[295]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
Feb 21, 2016, 3:07:37 PM lsd[295]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
Feb 21, 2016, 3:08:27 PM syslogd[51]: ASL Sender Statistics

感谢您的帮助

【问题讨论】:

    标签: cordova ionic-framework ios-simulator xcode7 osx-elcapitan


    【解决方案1】:

    我知道你说权限是正确的,但这篇文章似乎暗示权限问题可能是它的原因。

    http://zacvineyard.com/blog/2015/11/ionic-invalid-device-state-error-with-xcode-7-solved https://github.com/driftyco/ionic/issues/4052

    另外,您是否尝试过先打开 X-code,然后导航到 Ionic 平台/ios 文件夹以打开项目。从那里,您可以运行模拟器。

    关于 XPC 错误。 (这与 Ionic 完全不同。这是一个 OSX 问题)。


    Ionic 正在使用“LaunchServices”(使用 XPC)启动模拟器。在以下位置查看更多信息:

    https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html

    要解决错误“数据库映射失败,结果为 -10822”,您可能需要尝试重建启动服务数据库。看 http://hints.macworld.com/article.php?story=20031215144430486

    (kLSServerCommunicationErr -10822 错误是“与维护 Launch >Services 数据库的服务器进程通信时出现问题。”)

    另外,请参阅https://discussions.apple.com/message/7040998#7040998。我也会尝试“DiskUtility -> RepairPermissions”

    【讨论】:

    • 谢谢!我在本地安装了 ionic 和 cordova - 我不需要使用 sudo - 除非它以某种方式在引擎盖下被调用。令我感到羞耻的是,我没有直接从 Xcode 尝试过。现在第一次尝试时,它会构建应用程序,但模拟器永远不会完成加载它(类似于上面描述的第二种情况)。再次感谢
    • Brian,尝试在 /private/var/db/lsd 上将权限设置为 777 - 只是为了消除任何可能与该文件夹相关的权限的问题。 (但是一旦你完成了故障排除,一定要回到更合理的地方)
    • 你有没有找到这个布赖恩的来源?修改答案会很好(如果需要)。
    • 感谢您的建议,应用程序通过模拟器和本地设备上的 Xcode 加载。 Ionic/Cordova 命令仍未通过。再次感谢您迄今为止的时间。
    • 很高兴你得到它,Brian,所以一种解决方案是尝试直接从 Xcode 运行。使用离子命令(它们很方便,因此可能值得修复),您是否仍然获得“无效的设备状态”?您是否尝试过参考博客文章底部的步骤?另请参阅此链接github.com/driftyco/ionic/issues/4657
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-11
    • 2015-10-07
    • 1970-01-01
    • 2015-11-22
    • 2018-12-01
    • 2010-09-30
    • 1970-01-01
    相关资源
    最近更新 更多