1na-ko/dsh-hdc-bridge 预览 preview

1na-ko/dsh-hdc-bridge

DSH 原生鸿蒙开发助手:hdc 设备闭环调试 + 设备面板(官方 client 插件形态)+ 离线官方知识层(Tier-1 随包)+ DevEco CLI 构建/签名/模拟器控制

Project Overview项目介绍

This repository is a DSH-native plugin built exclusively for DeepSeek Harness to assist with HarmonyOS and OpenHarmony application development. It reuses the local 3.x version of the hdc binary to provide a full closed-loop debugging workflow on connected physical devices or emulators, eliminating the need to reimplement the hdc protocol from scratch. It integrates natively with DSH's tool card system and image reading functionality to streamline the full process from device inspection to post-change verification. To install the plugin, you can run dsh plugin add dsh-hdc-bridge via the DSH CLI, or install it directly from the GitHub repository, and it requires no additional build steps after installation.

It is targeted at developers working on HarmonyOS applications, and integrates a sidebar entry into the DSH interface for quick access to a draggable, resizable floating device panel. The plugin automatically probes your local environment for hdc, DevEco Studio, SDK and devecocli paths following a predefined detection order, so you do not need to manually configure most tool paths. Unlike many other tools that throw unhandled exceptions on failure, all tools in this plugin return a structured result with a clear error message and troubleshooting hint to help you resolve issues quickly.

The plugin is released under the permissive MIT open source license. It has been fully tested on Windows with DevEco Studio 6.1.1.300 and SDK API 24, and core functionality has been verified by community contributors on macOS. While Linux is only supported for the independent command line tool form, the plugin handles permission and sandbox policy issues gracefully by falling back to local hvigorw or hdc when DSH restricted policies block official commands. It requires a local installation of hdc 3.x as a dependency, and DevEco CLI is optional for advanced build and signing workflows.

这是一个为DeepSeek Harness(DSH)开发的原生鸿蒙开发插件,复用本地3.x版本的hdc二进制实现HarmonyOS/OpenHarmony应用的设备闭环调试能力,支持从查看设备信息、截图、分析问题、修改代码、安装包到结果验证的完整开发调试流程。它还内置官方优先的版本化知识层,自带离线一级官方文档节选,同时支持可选的官方DevEco CLI构建与签名通道。

面向HarmonyOS应用开发人员,开发流程中插件会自动检测本地hdc、DevEco Studio、SDK和devecocli环境,按照探测优先级定位工具链路径,所有工具调用失败后不会抛出异常,而是统一返回带错误原因和修复指引的结果对象,方便开发人员快速定位解决问题。侧边栏会新增鸿蒙开发入口,点击可打开可拖拽缩放的浮动设备面板,方便快速查看设备状态、获取截图和日志。

本插件采用MIT许可证开源,目前已在Windows+DevEco Studio 6.1.1.300+SDK API 24环境完成全量验证,macOS也经社区实测验证基础功能,Linux仅支持独立命令行工具形态。安装可通过DSH CLI直接从npm或GitHub仓库安装,无需额外构建步骤,依赖本地已安装的hdc工具和可选DevEco CLI。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 19 stars - an early-stage project星标 19,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-hdc-bridge

把 1na-ko/dsh-hdc-bridge 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-hdc-bridge

DSH 原生鸿蒙开发助手:hdc 设备闭环调试(看设备 → 截图 → 看图 → 改码 → 装包 → 验证)+ 官方优先版本化知识层(离线 Tier-1 随包 + SDK 机读 + 官方文档检索)+ 可选官方 DevEco CLI 构建/签名通道。 A DSH-native HarmonyOS dev assistant: the hdc device loop (inspect → screenshot → view → fix → install → verify), an official-first version-classified knowledge layer (offline Tier-1 bundled + SDK-accurate reads + official docs search), and an optional official DevEco CLI build/sign backend.

定位

hdc_mcp 等 MCP 服务器已覆盖 hdc 能力层。本插件不重写 hdc 协议,直接复用本机 hdc 二进制(3.x),价值在 DSH 原生层:

  • 会话内工具卡片与 read_image 原生闭环
  • 按调用会话解析沙箱策略(与 pwsh 工具同款路线),截图写入 <workspace>/.dsh-hdc/screenshots/
  • 结构化的失败上报(hdc 传输层退出码不可靠,插件用输出标记 + 落盘校验兜底)
  • v0.7 起面板按官方 client 插件形态集成(边栏入口 + 浮动面板 + 官方主题),v0.9 补齐会话级编译、静态检查、部署与日志工具(switch_cwd / build_project / arkts_check / start_app / hdc_log)

截图 / Screenshots

浮动设备面板(点左侧边栏「鸿蒙」入口打开;设备列表 / 系统区 / 工具链徽章 / hilog 尾部,官方主题随深浅色自适应):

鸿蒙开发面板

工具

约定:所有工具失败不抛异常,统一返回业务值 { ok: false, error, hint }(error 为可读原因,hint 为修复指引);成功返回带 ok: true 的结果对象。工具描述里同时给出 error 示例。这是本插件的显式约定(官方工具层允许抛 ToolFailure,本插件为面板/技能一致性选择返回值形式并在此声明)。

这份 README 是 dsh-hdc-bridge 的项目版使用手册。它不仅列出原始工具,还说明模型在真实鸿蒙工程中应如何编排调用、如何判断回退是否真的成功,以及安装本插件后新增的 DSH 能力边界。

工具 说明
hdc_list_targets 列出已连接设备/模拟器(空列表 + 连接指引)
hdc_connect hdc tconn(严格 host:port 校验)
hdc_shell 设备 shell(param get / ps / uitest dumpLayout…)
hdc_screenshot 截图 → 拉取 JPEG → 落盘校验(API 10+ 的 snapshot_display 仅支持 .jpeg)
hdc_install 安装 .hap(默认 -r;输出标记级失败检测)
hdc_hilog hilog 尾部 N 行(可选域名 -T 过滤,如 PARAM)
hdc_ui_dump 文本化 UI 快照:uitest 布局树 → 可见文本节点(纯文本模型的「文字截图」)
hdc_ui_find 按文本/hint 找控件:返回 bounds 与中心坐标,配合 tap 免手算坐标
hdc_ui UI 操作:tap / doubleTap / longPress / swipe / input / key(Back/Home/Power/keyID),配合 dump 形成「观察 → 操作 → 验证」闭环
hdc_app 应用管理:query / start / stop / clear-data / uninstall(破坏性动作已标注)
hdc_crash 崩溃抓取:faultlogger 目录里最近的 jscrash / cppcrash / appfreeze,可按包名过滤,并解析结构化摘要(错误名/信息/错误码/源码帧/已知错误码提示)
hdc_diag 诊断:shell 口味 / hdc 路径 / 策略解析 / 探测日志
错误码提示 install / app / build 失败按 11 条已知错误码附中文修复建议(9568332 签名未绑 UDID→AGC 登记设备、9568289/9568322 签名配置、1300002 空间不足…);签名类错误附三类修复(AGC 证书配置 / 重装自签名 / 换 debug 签名)+ 直达 AGC 链接
hms_setup 环境体检:hdc / DevEco Studio / SDK(API 版本) / devecocli / 设备五项 + 目标 API 版本三源解析(项目→设备→SDK)与不一致告警
hms_build 官方构建/签名/运行通道:status / build / run / sign / clean;devecocli 缺失时自动回退本机 hvigorw + hdc_install + hdc_app 闭环
hms_api 官方优先的版本化 API 知识:读本机 SDK .d.ts(@since/@deprecated/@syscap 精确到 API 版本),按目标版本分类"可用/已废弃/不可用"
hms_knowledge 离线随包官方知识层(Tier-1):OpenHarmony 官方文档(CC-BY-4.0)未改文字节选 28 篇高频 API 模块、窗口(window/Window 类)、导航组件 Navigation 与应用模型/ArkTS 指南(大文件按节选入,文件内附节选声明),无需 SDK/CLI/网络。catalog / read(先目录后按小节读)/ search
hms_docs 官方本地文档检索:devecocli docs search / read / catalog(Tier-2:全量文档,需 devecocli)
hms_api_change 官方跨版本破坏性变更扫描:devecocli check compat(versions / diff)——回答"知识在哪一版变了"
hms_lint 官方 lint:rules(本机 57+ 条 codelinter 规则索引)/ read-rule / check(devecocli check lint)
hms_emulator 官方模拟器控制(devecocli emulator):list / start / stop / create / delete + 状态注入 shake / power / rotate / volume / fold / battery / geolocation / sensor / scene;未装 CLI 时按官方 SKILL.md 指路安装(第 20 个工具)
switch_cwd 为当前会话切换 HarmonyOS 工程根目录,供后续编译工具使用
build_project 构建项目并验证新 .hap 产物;devecocli 通道失败时回退到本机 hvigorw
arkts_check 通过 DevEco Studio SDK ets-loader 进行 ArkTS 静态检查;未传文件时自动收集 .ets
start_app 不重新构建地部署启动;devecocli 不可用时回退至 hdc 安装和启动
hdc_log 收集、清除或列出设备日志;支持关键词、bundle 和 PID 过滤
运行时技能 hdc-bridge、deveco-cli、harmonyos-knowledge、deveco-compile 与本地 harmony-next 指引,模型按需加载
设备记忆 工具默认使用本会话上次使用的设备(显式 target 或面板点选设备即切换默认;掉线自动回退首台连接设备);hdc_list_targets 暴露 preferred/preferredActive 字段
设备面板 官方 client 插件形态(对齐平台 cordis 面板与社区远程控制插件):入口挂左侧边栏 sidebar.footer.action 槽位——折叠 rail 态 36px 圆钮 + 状态点 + 数量角标(多条目自动竖排成图标列),展开态「鸿蒙」标签 + 设备数按官方间距紧贴前序按钮;点击经 ReactDOM portal 打开右上角浮动面板(拖拽 / 八向缩放 / 收起 / 归位 / × 关闭,不打断主界面)——设备列表(型号/API/电池)、一键截图、hilog 尾部、系统区、工具链徽章;主题走官方 --dsw-alias-* token、样式按官方 data-plugin-css 约定注入、层级对齐官方弹层,随平台生命周期卸载;面板打开 8s/20s、关闭降为 60s 慢轮询(入口状态点保持新鲜);数据走 /api2/hdc-bridge/* 只读 REST;headless 宿主自动跳过
可选知识搭配 Tier-2 社区包 harmony-next.skills(无 LICENSE,不随包,用户自行 npx skills add linhay/harmony-next.skills)

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-continual-evolve 下一个 Next dsh-galgame →