iOS17.3升级后Flutter应用调试崩溃:调试器连接丢失求助
iOS17.3 下 Flutter 应用真机启动崩溃,Xcode 提示 "Lost connection to the debugger on iPhone" 错误
升级iPhone至iOS17.3后,Flutter开发的应用无法在真机正常构建,启动后立即崩溃,Xcode提示Lost connection to the debugger on iPhone错误(错误域IDEDebugSessionErrorDomain,代码22)。应用在安卓设备及TestFlight下载版本均能正常运行。
完整错误信息:
Lost connection to the debugger on “iPhone”. Domain: IDEDebugSessionErrorDomain Code: 22 Recovery Suggestion: Restore the connection to “iPhone” and run “Runner” again, or if “Runner” is still running, you can attach to it by selecting Debug > Attach to Process > Runner. User Info: { DVTErrorCreationDateKey = "2024-01-25 11:14:48 +0000"; IDERunOperationFailingWorker = DBGLLDBLauncher; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_isCoreDevice" = 1; "device_model" = "iPhone11,8"; "device_osBuild" = "17.3 (21D50)"; "device_platform" = "com.apple.platform.iphoneos"; "dvt_coredevice_version" = "355.7.7"; "dvt_mobiledevice_version" = "1643.60.2"; "launchSession_schemeCommand" = Run; "launchSession_state" = 2; "launchSession_targetArch" = arm64; "operation_duration_ms" = 62043; "operation_errorCode" = 22; "operation_errorDomain" = IDEDebugSessionErrorDomain; "operation_errorWorker" = DBGLLDBLauncher; "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.3 (Build 23D56) Xcode 15.2 (22503) (Build 15C500b) Timestamp: 2024-01-25T12:14:48+01:00
已尝试的操作:
- 更新Mac系统
- 重置iPhone
- 多次删除重装应用
- 清理Xcode的DerivedData文件
- 重装Xcode
其他用户反馈及解决方案
确实有不少Flutter开发者在升级iOS17.3后遇到相同问题,以下是社区验证有效的解决方法:
- 升级Flutter SDK到最新稳定版:iOS17.3的调试协议变化可能与旧版Flutter存在兼容性问题,执行
flutter upgrade升级后多数用户问题解决。 - 修改Xcode调试设置:打开
Product > Scheme > Edit Scheme,切换到Run > Info,将Debugger从LLDB改为GDB;或取消勾选Debug executable,启动应用后通过Debug > Attach to Process > Runner手动附加调试器。 - 禁用View Debugging:在
Edit Scheme > Run > Diagnostics中取消勾选View Debugging选项,日志显示该功能当前处于启用状态,可能引发兼容性问题。 - 使用Flutter命令行构建:执行
flutter run --release测试发布版是否能正常启动,或用flutter run -v查看详细日志定位具体崩溃原因。 - 检查签名配置:确认Xcode项目的开发者证书、Provisioning Profile有效,且iPhone已信任该开发者证书(路径:
设置 > 通用 > VPN与设备管理)。
内容的提问来源于stack exchange,提问作者Imit
相关产品推荐
相关产品推荐

