Introduction¶
When developing or automating Android in DeepSeek Harness (DSH), common practices involve back-and-forth screenshots, manual adb runs, or spinning up separate Appium / UIAutomator scripts. Agents can view logs but struggle to directly “see” the device screen in conversation, making it difficult to tap, drag, or read logcat within the same session.
DSH Android consolidates this workflow into a single plugin: driving emulators or USB devices via adb, displaying real-time visuals in the conversation sidebar, and offering 20 agent tools for building, interacting, and debugging. Below is an overview of its positioning, capabilities, and installation.
What This Is¶
DSH Android (npm package @zseven-w/dsh-android) is a client-side plugin for DeepSeek Harness, maintained by ZSeven-W. The current plugin version is 0.1.0-rc.4, validated on DSH 0.1.1-rc.1; the GitHub repo has approximately 95 stars and 6 forks.
In one line: it builds, runs, and interacts with an online Android device (emulator or USB phone) within DSH conversations, entirely driven by adb, without relying on external streaming services or loopback port proxies.
Core Features¶
Single ADB Code Path¶
The serial reported by adb devices -l is the device’s unique identifier—emulator-5554, USB serial, or ip:port targets are treated identically. The plugin does not bind to specific emulator products (AVD, Genymotion, WSA, etc.) nor distinguish between “emulator stacks” and “real device stacks.”
In-Process Live Stream and Sidebar Panel¶
Once streaming starts, the plugin spawns a persistent adb exec-out subprocess to repeatedly execute screencap -p. The host slices frames, generates a multipart/x-mixed-replace PNG stream, and serves it through DSH’s signed route /_dsh/dsh-android/*. The browser never communicates directly with adb, and there are no internal stream ports to proxy.
The sidebar panel renders real-time video, supports tapping and dragging on the video, and provides toolbar buttons for back, home, recent apps, rotation, screenshot, and refresh. The device menu can trigger the notification shade, quick settings, lock screen, wake, and voice assistant actions.
20 Agent Tools¶
Tools are registered on any host and return pure JSON. Visual content is presented via presentationMeta and signed routes—not sent as direct image blocks to the model (on models supporting image input, screenshot tools have additional native multimodal paths).
Coordinates are always normalized 0..1 relative to the stream frame; frames follow display rotation, and input tap shares the same coordinate space as the stream.
Core tools include:
| Tool | Function |
|---|---|
android_devices |
Enumerate adb devices and local AVD list |
android_boot |
Start streaming for an online serial, or cold-boot a specified AVD before streaming |
android_shutdown |
Shut down the emulator and stop streaming (adb cannot power off physical devices; it will explicitly refuse) |
android_screenshot |
Capture a PNG and return a JSON summary |
android_interact |
Tap, input, key events, gestures, scrolling |
android_list_apps / android_launch_app |
List and launch installed applications |
android_build_run |
Run ./gradlew assembleDebug, install the debug APK, and launch |
UI automation tools include android_ui_tree, android_tap_element, android_ui_rows, android_tap_row (based on uiautomator). Logging and debugging tools include android_logs, android_processes, android_backtrace, android_meminfo, android_app_info.
OCR tools android_find_text, android_tap_text, android_wait_for depend on Apple’s Vision framework on macOS and are only available on macOS hosts; the other 17 tools work on Linux and Windows.
Security Model¶
Stream and screenshot routes require loopback endpoints, loopback Host (rejecting DNS rebinding), and Fetch-Metadata/Origin same-origin checks. HMAC-SHA256 capabilities expire in about 10 minutes. Screenshot paths are checked with lstat at each level, symbolic links are rejected, and realpath performs inclusion validation.
Installation and Enabling¶
The plugin runs with the current DSH process’s permissions. Before installation, read the GitHub source and MIT license, and ensure a trusted adb and Android device are available.
Environment requirements (from the official README):
- Node ≥ 24.11.0
- adb (Android SDK platform-tools), resolved in order:
ADBenvironment variable →PATH→ SDK default path - An adb-visible device (emulator or phone with USB debugging enabled)
- DSH ≥ 0.1.0-rc.6 with web bundle for sidebar panel; headless configurations still support all 20 tools
Install the plugin and start a web session:
dsh plugin --profile web add @zseven-w/dsh-android@latest
dsh web
Alternatively, add the package as a dependency to an existing profile:
pnpm add @zseven-w/dsh-android
Non-ASCII text input (Chinese, emoji) requires optionally installing ADBKeyboard and setting it as the current input method; without it, related input will be rejected with a prompt.
Typical Usage¶
The official quick-start flow is as follows:
- Discover devices—have the agent call
android_devicesto obtain the serial or AVD name. - Start streaming—call
android_bootfor an online serial likeemulator-5554; passing an AVD name will cold-start the emulator (may take several minutes), and the panel will then show real-time video. - Interact—tap directly on the panel or use
android_interact; structured taps can useandroid_ui_tree+android_tap_element; when the control tree is unavailable, OCR tools can be used on macOS. - Build and run—call
android_build_runfor a Gradle project, specifyingprojectPath; a full build may take several minutes, after which the app installs and launches. - Read logs—
android_logscan filter by package name, e.g., viewing the last two minutes of logcat for an app.
Example conversation intents and corresponding tools:
List Android devices. → android_devices
Cast emulator-5554. → android_boot
Open Settings, then tap Display. → android_interact or android_ui_tree + android_tap_element
Build and run /path/to/MyApp. → android_build_run
View logcat for com.example.app in the last 2 minutes. → android_logs
Use Cases and Notes¶
Who It’s For
- Developers debugging Android apps, verifying UI, or checking logcat within DSH conversations.
- Automation scenarios requiring agents to drive real adb devices rather than relying on static screenshots.
- Teams with Gradle projects needing one-click build / install / launch within a session.
Usage Notes
- USB real devices typically achieve about 2–5 fps, emulators about 5–10 fps; the plugin README reports ~8 fps with a persistent screencap loop on an Android 14 emulator.
android_shutdowncannot turn off physical phones; adb lacks this capability, and the tool will state so.- When a device is
unauthorized, you must confirm USB debugging authorization on the phone screen;android_devicesreports the status rather than hiding the device. - If the emulator screen is entirely white/black but the control tree is normal, it may be a host-GPU framebuffer readback issue; try restarting with
emulator -avd <name> -gpu swiftshader_indirectfor software rendering. - The stream stops after about 5 minutes of consumer inactivity due to an idle policy; it will restart on the next tool call or panel open.
The DSH ecosystem follows an “everything is a plugin” philosophy; SkillHub is the community plugin directory and is not officially affiliated with DeepSeek or High-Flyer.
Links¶
- Community Directory: https://www.skillhub.cn/plugins/ZSeven-W/dsh-android
- GitHub Repository: https://github.com/ZSeven-W/dsh-android
- npm Package:
@zseven-w/dsh-android