Preface

In the development of agents within DSH (DeepSeek Harness), when tasks involve Android devices or bench rigs, a set of repetitive operations is usually encountered: listing devices, reading logcat, installing APKs, pulling files, viewing performance, waiting for conditions, and capturing crash dumps. dsh-adb encapsulates these operations as a DeepSeek Harness plugin, allowing agents to complete device and bench debugging via tool calls. Below is an introduction to its positioning, core capabilities, installation methods, and typical usage.

What is this

The maintainer of dsh-adb is SamXiaBing, and the license is MIT. The plugin is positioned as ADB device & bench operations for DeepSeek Harness, targeting Android devices and automotive/test bench debugging workflows.

The DSH plugin ecosystem emphasizes “everything is a plugin”; the community directory is an independent site and does not constitute an official subordinate relationship with DeepSeek / Fanghu.

Core Capabilities

Device Discovery

First use adb_devices to discover device serials, and then call subsequent tools based on the serial.

Structured logcat

adb_logcat is used to read filtered logcat. It can also run as a background job; during operation, job_output can be used to read increments, and job_kill to stop it.

Application and File Operations

The plugin provides basic capabilities such as APK installation and file pull/push. Operation records enter the operation ledger and are persisted to operations.json; when needed, applications can be rolled back to the last known good APK.

Performance Snapshots and Baselines

The plugin provides performance snapshots and perf baselines. Related reports and baselines are persisted to reportDir and baselineDir, facilitating subsequent comparison.

Device Health Report

The plugin provides one-click device health reports, which are persisted to reportDir.

Crash Collection

The crash chain usually starts with adb_watch_crash. After detecting a new crash, call adb_crash_report to get the crash dump, then call adb_screenshot to save the screen state. The plugin also registers a crash-analysis skill: dsh-adb-crash-analysis.

Condition Waiting and Patrol

adb_wait_for is used to wait for device conditions to be met; it returns matched:false on timeout.

adb_patrol_check provides one-click patrol and can be run unattended via dsh-automation. The patrol uses a fail-closed strategy: uncollectable sections themselves become issues; comparison is skipped when there is no baseline; the perf section is skipped when the package is omitted.

Web Device Panel

The plugin provides a web device panel, including autocomplete, live logcat, profiler, and other capabilities. Data flows via the package RPC channel.

Installation and Enablement

First, add the plugin to the web profile:

dsh plugin --profile web add dsh-adb

You can also install from GitHub:

dsh plugin --profile web add github:SamXiaBing/dsh-adb

After installation, the GUI needs to be restarted. The repository mentions scripts/restart-web.ps1, which can be used for one-click restart.

Configuration is written in cordis.patch.yml or profile patch. Verified example config items include adbPath and defaultSerial:

- id: dsh-adb
  name: dsh-adb
  config:
    adbPath: C:\Users\me\AppData\Local\Android\Sdk\platform-tools\adb.exe
    defaultSerial: emulator-5554

Refer to the configuration documentation in the repository for the full list of configuration items.

Typical Usage

Discover Device

First run:

adb_devices

After obtaining the serial, execute logcat, install, file, performance, or patrol tools.

Background Read logcat

First start adb_logcat as a background task, then use job_output to read increments, and finally use job_kill to stop it:

adb_logcat
job_output
job_kill

Wait for Condition

Use adb_wait_for to wait for device conditions to be met. If the budget runs out without a match, it returns:

{ "matched": false }

Crash Monitoring

adb_watch_crash can run in foreground or background. Parameter boundaries: timeoutMs max 600000, intervalMs min 250, withStacks default true. Boot markers are ignored at startup:

mtk-brm-*

After detecting a crash, follow the chain to collect:

adb_watch_crash
adb_crash_report
adb_screenshot

Patrol

Call adb_patrol_check for a one-time patrol; if scheduled is needed, combine with dsh-automation:

adb_patrol_check
dsh-automation

Suitable Scenarios and Notes

Suitable for debugging scenarios where agents need to operate Android devices or bench rigs, and logs/performance/crash evidence and rollback records are required.

Notes:

  • The plugin runs with the permissions of the current dsh process. It is recommended to check the source code and the MIT license before installation.
  • Errors return structured AdbError. Common stable error codes include:
ADB_NOT_FOUND
ADB_UNAVAILABLE
DEVICE_NOT_FOUND
NO_DEVICES
CONNECT_FAILED
INSTALL_FAILED
ADB_EXIT_<code>
  • Reports and baselines are saved in reportDir and baselineDir respectively; the operation ledger is saved in operations.json.

Links

Directory page link:

https://www.skillhub.cn/plugins/SamXiaBing/dsh-adb

GitHub:

https://github.com/SamXiaBing/dsh-adb