dsh-android v0.1.0-rc.1
Pre-releasedsh-android v0.1.0-rc.1
首个发布:对话里的实时 Android 设备——模拟器或 USB 真机,全程只靠 adb 驱动。/ The first release: a live Android device inside a DeepSeek Harness conversation — emulator or USB phone, driven entirely through adb.
✨ 核心设计 / Core design
- 纯 adb 中心 / adb is the only contract — 设备的唯一身份是
adb devices报出的 serial;模拟器与 USB 真机走同一条代码路径,没有 iOS 版那套 WebDriverAgent 构建/隧道/信任状态机,真机授权 USB 调试即插即用。emulator启动器只是可选发现项,发现不了只影响"启动 AVD"这一个动词。/ A device's one identity is its adb serial; emulators and USB phones share one code path. There is no WebDriverAgent-style build/tunnel/trust machinery — a phone that has authorized USB debugging just works. Theemulatorlauncher is a best-effort discovery used solely by the boot-an-AVD verb. - 进程内流水线,无外部依赖、无内部端口 / An in-process stream, no helper, no inner port — 单个持久
adb exec-out子进程跑screencap -p循环,宿主按 PNG IEND 自己切帧,路由直接从内存写 multipart 流。没有需要代理的回环流服务器、没有端口区间、没有孤儿收养——攻击面严格小于代理方案。实测模拟器 ~8 fps、首帧 ~200 ms、tap ~130 ms。/ One persistentadb exec-outchild loopsscreencap -p; the host splits the concatenated PNGs itself and serves the multipart stream straight from memory. Nothing to proxy, no port range, nothing to adopt. Measured: ~8 fps on an emulator, ~200 ms first frame, ~130 ms per tap. - 帧随显示旋转 / Frames follow display rotation — 横屏应用的帧直接是 2400×1080,tap 空间即帧空间,客户端不携带任何反向旋转数学。/ A landscape app streams 2400×1080 frames; the tap space IS the frame space, so the client carries no counter-rotation math.
🛠️ 20 个 Agent 工具 / 20 agent tools
devices · boot · shutdown · screenshot · interact · list_apps · launch_app · build_run (Gradle → install → launch) · ui_tree · tap_element · ui_rows · tap_row · find_text · tap_text · wait_for · logs (logcat) · processes · backtrace · meminfo · app_info
- 语义自动化:
uiautomator层级树、按resource-id/text/content-desc 点按、列表行计数器 ±1 验证;树失明时 Vision OCR(macOS 宿主)按像素找字/点字。/ Semantic automation: the uiautomator hierarchy, identity taps, list-row counter ±1 verification; Vision OCR (macOS host) reads and taps pixels when the tree is blind. - 错误即操作手册:失败必抛、消息带下一步指引;枚举失败绝不伪装成空列表。/ Errors are runbooks: failures always throw with the next step named; a failed listing never masquerades as an empty one.
🖥️ 侧边栏面板 / The sidebar panel
实时画面 + ◁ ○ □ 三键导航 + 旋转/截图/刷新 + 无框/边框/手机框 + 设备选择器(AVD 显示为"用 android_boot 启动"提示);直接在视频上点按拖拽,人机协同。/ The live view with Android's three-button navigation, rotate/screenshot/refresh, three frame styles, and a device picker (AVDs appear as boot-via-android_boot hints); tap and drag directly on the video.
🔐 安全模型 / Security model
与 dsh-ios 同款:HMAC-SHA256 capability(10 分钟过期)、loopback 三重围栏(peer + Host 反 DNS-rebinding + Fetch-Metadata/Origin)、截图目录 lstat+realpath 围栏。可视字节只经签名 URL 到达 UI。/ Same posture as dsh-ios: 10-minute HMAC capabilities, the triple loopback fence, and the screenshot-directory containment walk. Visual bytes reach the UI only through signed URLs.
📦 安装 / Install
dsh plugin --profile web add @zseven-w/dsh-android@next
dsh web要求 adb 可解析(ADB env / PATH / Android SDK platform-tools)。/ Requires a resolvable adb.
⚠️ 说明 / Notes
- npm dist-tag:
next。/ Published undernext. - 模拟器画面全白 → 用
-gpu swiftshader_indirect启动(部分 macOS 上 host-GPU 的 framebuffer 读回损坏,README 排障有记录)。/ A solid-white stream means broken host-GPU readback; relaunch the emulator with-gpu swiftshader_indirect. - CJK 文本输入需要设备装 ADBKeyboard;未装时报带安装指引的错误。/ CJK typing needs the ADBKeyboard IME on the device.
- 尚未实测:USB 真机全流程、
android_build_run对真实 Gradle 工程、AVD 冷启动路径。/ Not yet exercised live: the full USB-phone path,android_build_runagainst a real Gradle project, and the cold AVD boot. - 15 个语言的 README 与六件套封闭 smoke(含 KVM 模拟器 CI job)随包发布。/ Ships with 15 locale READMEs and six hermetic smoke suites plus a KVM emulator CI job.
Full Changelog: https://github.com/ZSeven-W/dsh-android/commits/v0.1.0-rc.1