SamXiaBing/dsh-adb ↗★ 2

dsh-adb

ADB device & bench operations for DeepSeek Harness: device discovery, structured logcat, apk install, file pull/push, performance snapshots, perf baselines, crash reports, one-click device health reports, condition waits, operation ledger w/ rollback, screenshots, crash watchdog, one-click device patrol (scheduled-watchdog ready), web device panel (autocomplete, live logcat, profiler) 适合需要进行Android设备日志抓取、应用安装和崩溃监控的开发者。

Package
dsh-adb
Compatibility
Unverified
Version
1.7.0
License
MIT
Last updated
Sep 7, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SamXiaBing/dsh-adb

Usage: adb_watch_crash (Crash Watchdog)

Watch the device's crash buffer for new real crashes. On start, it reads the current buffer and remembers every existing crash signature (seed), so only crashes that appear after the watch begins are reported. Boot markers (mtk-brm-*) are not crashes and are ignored.

Foreground mode (default) — blocks until a new crash appears or the budget expires:

// Agent calls:
{ "name": "adb_watch_crash", "args": { "timeoutMs": 60000 } }

// New crash detected:
{ "matched": true, "waitedMs": 3200, "crashes": [{ "time": "08-26 06:22:56.714", "pid": "2947", "tag": "AndroidRuntime", "message": "FATAL EXCEPTION: WM.task-1", "stack": ["AndroidRuntime: Process: com.miui.weather2, PID: 2947", "..."] }] }

// No new crash within budget (not an error):
{ "matched": false, "waitedMs": 60000, "crashes": [], "reason": "no new crash within 60000ms" }

Background mode (run_in_background) — returns a job id immediately, keeps polling:

// Start watching in the background:
{ "name": "adb_watch_crash", "args": { "run_in_background": true, "timeoutMs": 300000 } }
// → { "kind": "background", "jobId": "adb-watch-crash-1" }

// Read latest detections with job_output:
// [adb_watch_crash] detected 1 new crash(es) after 5400ms
// - 08-26 06:22:56.714 pid=2947 AndroidRuntime: FATAL EXCEPTION: WM.task-1
//     AndroidRuntime: Process: com.miui.weather2, PID: 2947
//     ...

Chain with crash capture — when a crash is detected, pair with adb_crash_report and adb_screenshot to capture the scene:

1. adb_watch_crash (watch for new crash)
2. → crash detected → adb_crash_report (full crash scene: buffer + dropbox + process + memory)
3.                    → adb_screenshot (screen state at crash time)
ParameterTypeDefaultDescription
serialstringdefaultSerialTarget device serial
timeoutMsinteger60000Watch budget (max 600000 = 10 min)
intervalMsinteger1000Poll interval (min 250)
withStacksbooleantrueInclude same-pid stack lines per crash
run_in_backgroundbooleanfalseRun as a background job; read via job_output

Configuration

Set the config block in cordis.patch.yml (or a profile patch):

- id: dsh-adb
  name: dsh-adb
  config:
    adbPath: C:\Users\me\AppData\Local\Android\Sdk\platform-tools\adb.exe
    defaultSerial: emulator-5554
    timeoutMs: 30000
KeyDescriptionDefault
adbPathAbsolute path to the adb executableAuto-detect PATH / ANDROID_HOME / ANDROID_SDK_ROOT/platform-tools
defaultSerialDefault target device serialnone
timeoutMsPer-command timeout30000
baselineDirDirectory for adb_perf_baseline storage~/.dsh/storages/dsh-adb
reportDirDirectory for adb_device_report storage/reports
screenshotDirDirectory for adb_screenshot storage/screenshots