# dsh-android-pane  A **live Android device pane** next to your DeepSeek Harness (DSH) conversation: emulators and USB phones alike. The agent drives the device and proves its work with screenshots plus a structured UI tree; you can jump in at any time. Screenshots, recordings and debug evidence are saved straight into a host directory you pick. [中文](README.md) · [Releases](https://github.com/hoyyang/dsh-android-pane/releases) · [Changelog](CHANGELOG.md)
## Install ```sh dsh plugin add github:hoyyang/dsh-android-pane ``` Zero configuration: no API keys, no DSH config edits. Requires `adb` on PATH (Android SDK), a device with USB debugging (or any emulator); macOS/Linux and the DSH web profile. Debug analysis needs `ffmpeg` / `ffprobe` on the host. Linux directory picking uses Zenity or KDialog. ## Who it is for - **Good fit**: you want the agent to actually tap an Android phone and return evidence; you want to watch the device inside DSH and take over; you need screenshots, recordings and debug logs archived in a fixed directory. - **Good fit**: reproducing a reported tap path, accepting UI changes, recording the actions before a crash. - **Not a fit**: static screenshots only; root-level injection or system modification (it never roots automatically); remote control outside the machine (loopback only). ## Features - **A real right-hand column**: docked third in "conversation | right sidebar | Android pane | card detail", covering neither side; below 1000px it becomes a floating window. - **Device picker**: the header lists online devices with model names and rebuilds the stream when you switch. - **Full path bar**: the current save directory stays visible, wraps long paths, and its gear opens directory settings. - **Bottom device keys**: back, home, recents, text input, mute and recent saves stay pinned below the picture. - **Live stream**: scrcpy-server H.264 straight into the DSH web UI, decoded with WebCodecs; falls back to screenshot polling when scrcpy cannot run. - **Real input in the pane**: press, drag and release on the H.264 picture are injected live; wheel input is normalized per pixel/line/page. - **Keys and Chinese input**: back / home / recents / rotate / volume, plus clipboard-based Chinese text after a one-time ADBKeyboard setup. - **Element-level actions**: `android_pane_ui` finds widgets by fuzzy text and taps their authoritative center instead of guessed coordinates. - **Screenshots saved for real**: one click writes a PNG into the unified directory and reports the full path. - **Recordings saved for real**: start, watch the timer, stop to save an MP4; the 180-second limit saves automatically while the device stays usable. - **Debug sessions saved for real**: segmented MP4 + full logcat + action timeline, same prefix and directory. - **Debug analysis**: per-action pre/post frames plus log slices, with frame times derived from the device clock and embedded recording timestamps; missing evidence is reported instead of invented. - **One save directory**: Desktop bridge or host picker, draft-only selection, locked during capture, retry with another directory on failure. - **Pending saves survive reloads**: recording and debug intents are persisted by the host and can still be saved afterwards. - **Media mute and restore**: mute device media with one click and restore the previous volume. - **Protected pages degrade honestly**: FLAG_SECURE is detected, the banner explains the limit, and a tappable element-tree view stays available; no automatic root. - **Human/agent exclusion**: panel input is refused while an agent owns the device, with an explicit takeover; everything resumes after release and reconnect. - **Disconnects never fake success**: capture and actions fail loudly while the device is gone and recover after reconnect. ## Quick start 1. Enable USB debugging and connect a phone (or start any emulator). 2. Click "Android pane" in the DSH session header. 3. The pane selects the online device and starts streaming. 4. Tap, drag and scroll directly on the picture. 5. Ask the agent to "connect my Android device" and it claims the device for input. 6. Click Screenshot and read the saved path shown below the picture. 7. Click Record, watch the in-place timer, click again to save an MP4. 8. Click Debug, perform a few actions, then stop to save video, log and timeline together. 9. Ask the agent to analyze and it receives per-action frames plus log slices. 10. Install the IME for Chinese input; click Mute for media silence. ## Use cases - Reproduce a reported tap path and archive a screenshot per step. - Accept UI changes on a real device and keep every screen. - Record an intermittent problem, then stop and use the MP4. - Capture the action sequence before a crash with debug mode and full logcat. - Locate widgets and text through the element tree, then tap precisely. - Verify Chinese input through ADBKeyboard and read the EditText back. - Exercise FLAG_SECURE pages and confirm the banner and element-tree fallback. - Compare devices through the same actions and save directory. - Keep long tasks segmented: debug mode rotates every 170 seconds. - Rehearse failure recovery with a read-only directory or an unplugged cable. ## Outputs - A screenshot writes a 592×1280 PNG and reports the full path in the pane. - A recording writes an MP4 and the timer stops in place. - A debug session writes segmented MP4s (170s + tail), a full logcat file and an actions.json timeline. - Analysis writes per-action pre/post PNG frames with uncertainty and calibration status. - Failures write nothing into the registry and keep the pending save plus a retry path. ## Advanced - **Chinese input**: `android_pane_install_ime` once, then send text from the pane. - **Element actions**: `android_pane_ui` find/click/setText. - **Secure-page switch**: config `flagSecureCheck` (default true). - **Quality**: switch clear/fluid in settings; the stream reconnects with new bounds. - **Reconnect**: use "Reconnect device" or reselect the device. - **Dock/floating**: switch in settings; narrow windows float and return on restore. - **Recent saves**: the bottom folder button previews images and videos. - **Debug analysis**: stop a debug session, then analyze for frames and log slices. - **Retry saving**: keep the pending record and retry with a writable directory. - **Uninstall**: `dsh plugin remove @dsh-external/dsh-android-pane`; state lives in `