HarmonyOS 鸿蒙Next DevEco 3.1 debug调试报错,Failed to connect to the debug server

发布于 1周前 作者 nodeper 来自 鸿蒙OS

HarmonyOS 鸿蒙Next DevEco 3.1 debug调试报错,Failed to connect to the debug server

debug run模式下报错,如图:

cke_558.png

导致工程无法打断点调试,请求帮助



关于HarmonyOS 鸿蒙Next DevEco 3.1 debug调试报错,Failed to connect to the debug server的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。

3 回复

您好,这个报错可能是端口被占用了

看一下右小角是否有小红点,通过右下角的小红点展开错误信息就能看到 Address already in use 错误,如果没有弹出则查看 idea.log 日志中是否打印

启DevEco Studio或者通过 cmd 命令行 netstat -an|finstr "xxx" 查看端口被谁占用了然后 kill 掉再调试

2024-08-29 09:32:56,928 [57918510] INFO - #com.huawei.hvigor.run.HvigorRunConfiguration - Launch succeeded 2024-08-29 09:32:56,933 [57918515] INFO - #com.huawei.hvigor.utils.HvigorProcessUtil - Check process is available. 2024-08-29 09:32:56,933 [57918515] INFO - #com.huawei.hvigor.utils.HvigorProcessUtil - Execution command: ‘[ps -fp 53049]’ 2024-08-29 09:32:56,943 [57918525] INFO - #com.huawei.hvigor.utils.HvigorProcessUtil - Execution command completed 2024-08-29 09:32:56,943 [57918525] INFO - #com.huawei.hvigor.utils.HvigorProcessUtil - Execution result: UID PID PPID C STIME TTY TIME CMD 501 53049 1 0 9:32AM ?? 0:00.97 /Users/a123/nodejs/bin/node /Users/a123/.hvigor/project_caches/fb45a47b7d12b68910341db4be0aaf21/workspace/node_modules/.pnpm/@ohos+hvigor@2.4.2/node_modules/@ohos/hvigor/src/base/daemon/process/daemon-process-boot-script.js INFO 2024-08-29 09:32:56,943 [57918525] INFO - #com.huawei.hvigor.utils.HvigorProcessUtil - call process.destroy() method. 2024-08-29 09:32:56,943 [57918525] INFO - #com.huawei.hvigor.run.HvigorRunManager - No need to download SDK. 2024-08-29 09:32:56,952 [57918534] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(Output, fn) 2024-08-29 09:32:56,952 [57918534] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(BuildStatus, fn) 2024-08-29 09:32:56,952 [57918534] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(connect, fn) 2024-08-29 09:32:56,952 [57918534] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(connect_error, fn) 2024-08-29 09:32:56,952 [57918534] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(disconnect, fn) 2024-08-29 09:32:56,953 [57918535] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(WatchResult, fn) 2024-08-29 09:32:56,953 [57918535] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.on(WatchLog, fn) 2024-08-29 09:32:56,961 [57918543] INFO - #com.huawei.hvigor.client.connect.HvigorConnection - socket.emit(CommonBuild, [{“mode”:“module”,“watch”:true,“prop”:[“module=entry@default”,“product=default”,“debuggable=true”,“hotReload=true”],"_":[“assembleHap”]}]) 2024-08-29 09:32:56,986 [57918568] INFO - #com.huawei.hvigor.client.connect.HvigorConnector - connected… 2024-08-29 09:33:01,068 [57922650] INFO - #c.i.c.ComponentStoreImpl - Saving appHttpConfigurable took 20 ms 2024-08-29 09:33:01,099 [57922681] INFO - #c.i.c.ComponentStoreImpl - Saving Project(name=chat68, containerState=COMPONENT_CREATED, componentStore=/Users/a123/Desktop/Working/240506/chat68)RunManager took 12 ms 2024-08-29 09:33:12,311 [57933893] INFO - #com.huawei.hvigor.run.HvigorRunConfiguration - /Users/a123/nodejs/bin/node /Users/a123/.hvigor/project_caches/fb45a47b7d12b68910341db4be0aaf21/workspace/node_modules/@ohos/hvigor/bin/hvigor.js --mode module -p module=entry@default -p product=default -p debuggable=true -p hotReload=true assembleHap --watch 2024-08-29 09:33:12,311 [57933893] INFO - #com.huawei.hvigor.run.HvigorRunConfiguration - Launch succeeded 2024-08-29 09:33:12,318 [57933900] INFO - #com.huawei.ide.lemon.subscriptions.ApplicationSubscriber - HarmonyCustomTopic message logged 2024-08-29 09:33:12,405 [57933987] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Starting to execute the deployment task. 2024-08-29 09:33:12,497 [57934079] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Force stopping com.example.chat68 2024-08-29 09:33:12,504 [57934086] INFO - #com.huawei.ace.lsp.extensions.client.SendMessageOfSelectedEditorsManager - sendCheckFileMessage: onCheckCurrentlyEditFile after create/delete/move/rename file, project = chat68 2024-08-29 09:33:12,752 [57934334] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Ending force stop with result: true 2024-08-29 09:33:12,752 [57934334] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Starting to uninstall com.example.chat68. 2024-08-29 09:33:15,126 [57936708] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Ending uninstall with result: true 2024-08-29 09:33:15,127 [57936709] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Starting to push /Users/a123/Desktop/Working/240506/chat68/entry/build/default/outputs/default/entry-default-signed.hap to /sdcard/42f2b571567c450998fb74d115b9a681/entry-default-signed.hap. 2024-08-29 09:33:16,603 [57938185] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - End pushing successfully. 2024-08-29 09:33:16,604 [57938186] INFO - #com.huawei.ide.lemon.subscriptions.ApplicationSubscriber - HarmonyCustomTopic message logged 2024-08-29 09:33:16,604 [57938186] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Starting to install to /sdcard/42f2b571567c450998fb74d115b9a681/. 2024-08-29 09:33:20,040 [57941622] INFO - #com.huawei.ide.lemon.subscriptions.ApplicationSubscriber - HarmonyCustomTopic message logged 2024-08-29 09:33:20,041 [57941623] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Ending install with result: true 2024-08-29 09:33:20,041 [57941623] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Removing temporary directory /sdcard/42f2b571567c450998fb74d115b9a681 2024-08-29 09:33:20,143 [57941725] INFO - #com.huawei.deveco.debugger.hos.run.tasks.DeployHapTask - Ending remove temp directory with result: true 2024-08-29 09:33:22,044 [57943626] INFO - #com.huawei.dap.util.ShellUtils - Debug tcp port 15041 is not occupied with querying result “” 2024-08-29 09:33:22,092 [57943674] INFO - #com.huawei.deveco.ace.debug.hos.sourcemap.HarmonyForwardOperation - Ace debug socket address 13564 + com.example.chat68 exists. 2024-08-29 09:33:22,100 [57943682] INFO - #com.huawei.deveco.ace.debug.hos.run.HarmonyAceProgramRunner - multi instance debug mode. 2024-08-29 09:33:22,296 [57943878] INFO - #com.huawei.dap.util.ShellUtils - Debug tcp port 25039 is not occupied with querying result “” 2024-08-29 09:33:22,357 [57943939] INFO - #com.huawei.deveco.ace.debug.hos.sourcemap.HarmonyForwardOperation - Ace debug socket address 13564 + com.example.chat68 exists. 2024-08-29 09:33:22,405 [57943987] INFO - #com.huawei.dap.util.ShellUtils - Debug tcp port 15037 is not occupied with querying result “” 2024-08-29 09:33:22,422 [57944004] INFO - #com.huawei.deveco.ace.debug.connectserver.ConnectServerSession - WebSocket client opened. 2024-08-29 09:33:22,425 [57944007] INFO - #com.huawei.deveco.ace.debug.hos.run.ConnectServer - received message {“instanceId”:0,“name”:“PandaDebugger”,“type”:“addInstance”,“tid”:13564} 2024-08-29 09:33:22,470 [57944052] INFO - #com.huawei.dap.util.ShellUtils - Debug tcp port 15041 is not occupied with querying result “” 2024-08-29 09:33:22,675 [57944257] INFO - #com.huawei.dap.util.ShellUtils - Debug tcp port 25040 is not occupied with querying result “” 2024-08-29 09:33:22,688 [57944270] INFO - #com.huawei.dap.framework.DSPClient - InitializeRequestArguments [ clientID = “devecostudio” clientName = “DevEco Studio” adapterID = “devtools” locale = “en” linesStartAt1 = true columnsStartAt1 = true pathFormat = “path” supportsVariableType = true supportsVariablePaging = true supportsRunInTerminalRequest = true supportsMemoryReferences = null supportsProgressReporting = null supportsInvalidatedEvent = null ] 2024-08-29 09:33:22,709 [57944291] INFO - #com.huawei.dap.framework.DSPClient - {type=panda, request=launcher} 2024-08-29 09:33:22,711 [57944293] WARN - #com.huawei.deveco.xraydebug.ohos.provider.OhosXrayService - Unsupported type. 2024-08-29 09:33:23,092 [57944674] INFO - #com.huawei.deveco.ace.debug.hos.sourcemap.HarmonyForwardOperation - Ace debug socket address 13564 + PandaDebugger exists. 2024-08-29 09:33:23,109 [57944691] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Debugger.breakpointResolved 2024-08-29 09:33:23,109 [57944691] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Debugger.paused 2024-08-29 09:33:23,109 [57944691] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Debugger.resumed 2024-08-29 09:33:23,109 [57944691] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Debugger.scriptFailedToParse 2024-08-29 09:33:23,110 [57944692] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Debugger.scriptParsed 2024-08-29 09:33:23,110 [57944692] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Runtime.executionContextDestroyed 2024-08-29 09:33:23,110 [57944692] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Runtime.consoleAPICalled 2024-08-29 09:33:23,110 [57944692] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Console.messageAdded 2024-08-29 09:33:23,110 [57944692] INFO - #com.huawei.deveco.panda.message.RetryCommandInvocationHandler - debug event: Debugger.nativeCalling 2024-08-29 09:33:23,202 [57944784] INFO - #com.huawei.deveco.sourcemap.MyFileTypeDetector - MyFileTypeDetector#detect error:The JSON file does not contain the version and name fields.

日志如上所示,请帮忙分析下具体原因所在,已经困扰团队很多天了,感谢

回到顶部