Xcode部署iOS真机遇OSStatus error -10814问题求助
问题描述
使用搭载M2芯片的MacBook Pro(系统版本macOS 14.2.1),通过Xcode 15.1将Ionic Capacitor项目部署至iOS真机(iPhone、iPad,系统版本17.1.2)时,出现错误:
The operation couldn’t be completed. (OSStatus error -10814.) Domain: IDELaunchCoreDevice Code: 0 Recovery Suggestion: Verify that the Developer App certificate for your account is trusted on your device. Open Settings on the device and navigate to General -> VPN & Device Management, then select your Developer App certificate to trust it. User Info: { DVTErrorCreationDateKey = "2023-12-23 10:42:00 +0000"; IDERunOperationFailingWorker = IDELaunchCoreDeviceWorker; } -- The operation couldn’t be completed. (OSStatus error -10814.) Domain: NSOSStatusErrorDomain Code: -10814 User Info: { "_LSFunction" = runEvaluator; "_LSLine" = 1608; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_isCoreDevice" = 1; "device_model" = "iPhone12,3"; "device_osBuild" = "17.1.2 (21B101)"; "device_platform" = "com.apple.platform.iphoneos"; "dvt_coredevice_version" = "355.7.6"; "dvt_mobiledevice_version" = "1643.60.2"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 84635; "operation_errorCode" = 0; "operation_errorDomain" = IDELaunchCoreDevice; "operation_errorWorker" = IDELaunchCoreDeviceWorker; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphoneos"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 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" = 99; "param_launcher_substyle" = 8192; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphoneos17.2"; "sdk_osVersion" = "17.2"; "sdk_variant" = iphoneos; } -- System Information macOS Version 14.2.1 (Build 23C71) Xcode 15.1 (22502) (Build 15C65) Timestamp: 2023-12-23T11:42:00+01:00
错误提示需在设备「设置-通用-VPN与设备管理」中信任开发者App证书,但该界面找不到对应选项。此前部署正常,近期仅少量修改代码,切换至历史可正常运行的提交后问题仍存在,部署至模拟器无异常。
解决方案
针对iOS 17+系统的证书信任逻辑变化,按以下步骤排查解决:
确认App已安装到设备
只有Xcode成功将App部署到真机后,「设备管理」选项才会在设置中显示。先检查设备主屏幕是否有该App图标:- 断开设备与Mac的连接,关闭Xcode
- 重启设备和Mac
- 重新连接设备,在Xcode中选择目标设备,点击「运行」按钮重新部署
iOS 17+中「设备管理」的正确打开方式
iOS 17之后,入口路径为设置 → 通用 → VPN与设备管理,若未显示选项:- 进入「设置-通用」后,下拉到底部等待3-5秒(部分场景下选项加载有延迟)
- 若仍未显示,直接打开设备上已安装的待信任App,此时会弹出「未受信任的开发者」提示,点击「取消」后返回「通用」,「VPN与设备管理」选项会自动出现
检查开发者账号与证书状态
- 打开Xcode,进入「Settings → Accounts」,选中当前开发者账号,点击「Manage Certificates」
- 确认「iOS Development」证书存在且未过期,若过期或缺失,点击「+」按钮重新添加
- 回到设备,在「VPN与设备管理」中找到对应开发者证书,点击「信任」完成配置
重置Xcode与设备的配对连接
- 在Xcode中,点击「Window → Devices and Simulators」
- 选中连接的真机,右键选择「Unpair Device」
- 断开设备后重新连接,按提示完成配对流程,之后再次尝试部署
同步Capacitor项目配置
- 进入项目的iOS目录,打开
App.xcworkspace - 确认「Signing & Capabilities」面板中,Team已选择正确的开发者账号,Bundle Identifier未被其他项目占用
- 执行命令
npx cap sync ios重新同步项目配置,之后再尝试部署
- 进入项目的iOS目录,打开
内容的提问来源于stack exchange,提问作者Felix Olszewski
相关产品推荐
相关产品推荐

