当我运行cordova emulate ios
(或ionic emulate ios
)时,我收到无效的设备状态错误代码= 159。如果我打开模拟器,重置内容,并重新运行命令,我没有得到上述错误,但模拟器永远不会完成加载应用程序。
在这两种情况下,系统都会记录来自XPC_ERROR_CONNECTION_INTERRUPTED
或instruments
的数百个mdworker
条目。这是最近几次尝试的最后几次:
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
感谢您的帮助
答案 0 :(得分:0)
我意识到你说权限是正确的,但这篇文章似乎暗示权限问题可能是它的原因。
http://zacvineyard.com/blog/2015/11/ionic-invalid-device-state-error-with-xcode-7-solved https://github.com/driftyco/ionic/issues/4052
另外,您是否尝试先打开X代码,然后导航到Ionic平台/ ios文件夹以打开项目。从那里,您可以运行模拟器。
关于XPC错误。 (这与Ionic完全分开。这是一个OSX问题)。
Ionic正在使用" LaunchServices"启动模拟器。 (使用XPC)。详情请见:
要解决错误"数据库映射失败,结果为-10822",您可能需要尝试重建Launch Services数据库。看到 http://hints.macworld.com/article.php?story=20031215144430486
(kLSServerCommunicationErr -10822错误是"与维护Launch> Services数据库的服务器进程通信时出现问题。")
另请参阅https://discussions.apple.com/message/7040998#7040998。我也尝试" DiskUtility - > RepairPermissions"