Xcode 9 iOS模拟器 - 无法获取有效的流程句柄

时间:2017-10-03 06:00:34

标签: ios xcode ios-simulator ios11 xcode9

我已升级到Xcode 9,iOS模拟器10.3和11无效。所有股票和我的应用程序都在试图运行时强行关闭。

当我尝试运行日历,首选项等时,

Xcode Console错误如下所示。"无法获得有效的进程句柄"意思?

Process handle (com.apple.Preferences, <BSProcessHandle: 0x7fe84552b8b0; Preferences:9270; valid: NO>) is invalid. Returning error {
    BKSProcessExitReason = 0;
    BKSProcessJobLabel = "UIKitApplication:com.apple.Preferences[0x90bf][6825]";
    NSLocalizedFailureReason = "Unable to obtain valid process handle";
}

[com.apple.Preferences] Bootstrap failed with error: <NSError: 0x600000846c60; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Unable to obtain valid process handle">

Bootstrapping failed for <FBApplicationProcess: 0x7ffae944f990; com.apple.Preferences; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID com.apple.Preferences" UserInfo={NSLocalizedFailureReason=Unable to obtain valid process handle, BKSProcessExitReason=0, BSErrorCodeDescription=bootstrap-failed, BKSProcessJobLabel=UIKitApplication:com.apple.Preferences[0x90bf][6825], NSLocalizedDescription=Unable to bootstrap process with bundleID com.apple.Preferences}

Process handle (com.apple.mobilecal, <BSProcessHandle: 0x7fe845525860; MobileCal:9363; valid: NO>) is invalid. Returning error {
    BKSProcessExitReason = 0;
    BKSProcessJobLabel = "UIKitApplication:com.apple.mobilecal[0xf53][6825]";
    NSLocalizedFailureReason = "Unable to obtain valid process handle";
}

[com.apple.mobilecal] Bootstrap failed with error: <NSError: 0x604000643ae0; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Unable to obtain valid process handle">

Bootstrapping failed for <FBApplicationProcess: 0x7ffaeb141220; com.apple.mobilecal; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID com.apple.mobilecal" UserInfo={NSLocalizedFailureReason=Unable to obtain valid process handle, BKSProcessExitReason=0, BSErrorCodeDescription=bootstrap-failed, BKSProcessJobLabel=UIKitApplication:com.apple.mobilecal[0xf53][6825], NSLocalizedDescription=Unable to bootstrap process with bundleID com.apple.mobilecal}

Unable to find framework using path: /System/Library/Frameworks/VideoSubscriberAccount.framework

我已经在iOS 11 / 10.3.1的iPhone X,iPhone 8/8 +和iPhone 6+模拟器上试用了它,所有这些都具有相同的崩溃结果。如果我在较旧的iOS模拟器(如iPhone 6+ iOS 9.2)上试用它,那么它运行正常。

如果我尝试多次启动它,即Safari或日历的40-50次,有时特定的应用程序可能会运行,并且一旦成功运行,它将保持如此其余的会话(直到我在任务切换器关闭应用程序,然后同样的问题再次出现)。我的Xcode编译应用程序也是如此。

我的iMac 2009一直在运行El Capitan和Xcode 8,我刚刚使用Xcode 9升级到High Sierra。

我尝试过Xcode 9.1 Beta,但同样的问题仍然存在。

请帮助,谢谢。

1 个答案:

答案 0 :(得分:2)

感谢@ russbishop关于禁用第三方内核扩展的建议,我找到了罪魁祸首 - One Periodic's Hands Off Firewall

我用这个命令卸载了kext:

func someFunc(_ values: [Float]) {
    for value in values {
        //we need to make that value mutable. You can use inout to make parameters mutable, or use vars in "for in" statement
        var unsafeValue = value
        //then put that value to the C function using "&"
        someCFunc(value: &unsafeValue)
    }

}

立即iOS模拟器中的所有股票应用程序都可以完美地启动。请注意,您必须 卸载 kext。简单地禁用Hands Off中的规则并不能解决问题。

然而,我不能&#34; kextload &#34;完成重新激活防火墙后,请关闭Hands Off驱动程序。需要重启系统。

我已经向Hands Off报告了这个问题,希望在下一个版本中看到修复。

感谢@JeremyHuddlestonSequoia帮助诊断。