dsh-tool-adb
文件与数据 活跃维护

dsh-tool-adb

lijiajia96/dsh-tool-adb

将ADB设备管理、Shell执行、应用安装卸载、截图、文件传输、日志查看等常用能力封装为模型可直接调用的工具,无需额外配置即可让AI模型操控安卓设备完成调试任务。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
TypeScript
主要语言
None
开源协议
8 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:lijiajia96/dsh-tool-adb
git clone https://github.com/lijiajia96/dsh-tool-adb.git
git clone git@github.com:lijiajia96/dsh-tool-adb.git
README.md main

@deepseek-ai/dsh-tool-adb

DeepSeek Harness plugin that exposes Android Debug Bridge (adb) operations as model-facing tools.

Features

Tool Description
adb_devices List connected Android devices and emulators
adb_shell Execute shell commands on a device
adb_install Install APK files onto a device
adb_uninstall Uninstall apps from a device
adb_screenshot Capture device screenshots to local workspace
adb_pull Copy files/directories from device to local
adb_push Copy files/directories from local to device
adb_logcat Capture logcat output (with optional tag filter)

Installation

Prerequisites

  • Android SDK platform-tools (adb on PATH)
    • macOS: brew install android-platform-tools
    • Linux: sudo apt install android-sdk-platform-tools
    • Windows: download from developer.android.com

As a local plugin (development)

Add to your profile's cordis.patch.yml:

- insert:
    - id: tool-adb
      name: /absolute/path/to/packages/android/tool-adb/lib/index.js
      config:
        devices: true
        shell: true
        install: true
        uninstall: true
        screenshot: true
        fileTransfer: true
        logcat: true
        timeoutMs: 30000

Or launch with a patch file:

dsh web --patch ./adb-plugin-patch.yml

Configuration

Option Type Default Description
devices boolean true Register adb_devices
shell boolean true Register adb_shell
install boolean true Register adb_install
uninstall boolean true Register adb_uninstall
screenshot boolean true Register adb_screenshot
fileTransfer boolean true Register adb_pull and adb_push
logcat boolean true Register adb_logcat
timeoutMs number 30000 Per-command timeout in milliseconds

Usage Pattern

The model should always call adb_devices first to obtain a device serial, then pass that serial to other tools.

Example workflow:

  1. adb_devices → find serial ABC123
  2. adb_shell device=ABC123 command=pm list packages | grep com.example
  3. adb_screenshot device=ABC123 → saves screenshot locally
  4. adb_logcat device=ABC123 filter=MyApp:D *:S → capture filtered logs

Development

# Typecheck
pnpm --filter @deepseek-ai/dsh-tool-adb exec tsc --noEmit

# Build
pnpm --filter @deepseek-ai/dsh-tool-adb exec tsc

# Smoke test (requires adb on PATH)
node --import tsx packages/android/tool-adb/tests/smoke.test.ts

License

MIT