升级macOS13/Xcode14 Beta后iOS16模拟器报.xpc错误如何解决
问题描述
- 触发场景:升级至macOS 13.0 Beta版本、安装Xcode 14.0 Beta版本后,将开发的App目标操作系统版本设置为iOS 16,尝试在iOS模拟器中运行时触发报错
- 异常表现:不仅Xcode侧启动App失败,即便手动启动iPhone模拟器也无法正常加载
- 对照测试结果:同一款App在搭载iPadOS 16.0的实体iPad设备上运行无任何异常
- 报错参考截图:


完整错误信息
Details The operation couldn’t be completed. xpc error Domain: NSPOSIXErrorDomain Code: 64 Failure Reason: xpc error User Info: { DVTErrorCreationDateKey = "2022-06-17 16:19:12 +0000"; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; } -- Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "iPhone14,3"; "device_osBuild" = "16.0 (20A5283p)"; "device_platform" = "com.apple.platform.iphonesimulator"; "launchSession_schemeCommand" = "Run"; "launchSession_state" = 1; "launchSession_targetArch" = "x86_64"; "operation_duration_ms" = 44430; "operation_errorCode" = 64; "operation_errorDomain" = "NSPOSIXErrorDomain"; "operation_errorWorker" = "IDELaunchiPhoneSimulatorLauncher"; "operation_name" = "IDERunOperationWorkerGroup"; "param_consoleMode" = 0; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphonesimulator"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_runnable_type" = 2; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphonesimulator16.0"; "sdk_osVersion" = "16.0"; "sdk_variant" = "iphonesimulator"; } -- System Information macOS Version 13.0 (Build 22A5266r) Xcode 14.0 (21257.0.0.0.22) (Build 14A5228q) Timestamp: 2022-06-17T11:19:12-05:00
排查解决步骤
按优先级从高到低依次尝试以下操作,多数场景下前2个方案即可解决问题:
- 校验模拟器架构匹配性
从错误日志可见当前启动的目标模拟器为x86_64架构,若使用Apple Silicon(M系列)芯片的Mac,异常创建的x86_64架构模拟器会因Rosetta转译兼容问题触发XPC通信失败。操作方式:删除现有报错的模拟器设备,在Xcode的「Window > Devices and Simulators」面板中重新创建对应iPhone机型、iOS 16版本的模拟器,确认设备架构为arm64后再尝试启动。 - 重置模拟器运行状态
完全退出Xcode、Simulator程序,打开终端执行以下命令:xcrun simctl shutdown all && xcrun simctl erase all
命令执行完成后重启Xcode,重新选择模拟器启动即可。 - 修复开发者工具权限
macOS 13早期Beta版的隐私权限机制调整,可能拦截模拟器相关XPC服务的正常通信。操作路径:打开系统设置→隐私与安全性→开发者工具,确认Xcode、Simulator均在允许列表中且权限开关为开启状态;若列表无对应程序,手动启动一次Xcode触发权限申请,完成授权后重启两个程序再试。 - 清理开发缓存
完全退出Xcode,在访达中按Shift+Command+G分别进入以下两个目录,删除目录下所有文件:~/Library/Developer/Xcode/DerivedData/~/Library/Developer/CoreSimulator/Caches/
清理完成后重启电脑,再尝试启动模拟器。
注:macOS 13、Xcode 14早期Beta版本本身存在大量框架层兼容性问题,若以上操作均无效,升级至更新的Beta版本或正式版系统、Xcode即可解决这类底层通信错误。
内容的提问来源于stack exchange,提问作者Felix Lunzenfichter
相关产品推荐
相关产品推荐

