@lmliheng/android-adb
v0.1.0
Published
Drive an Android phone over USB with adb from the shell: repair a dropped connection, take screenshots, tap, swipe, type, launch apps and read the screen — including apps that block UI dumps, such as WeChat.
Maintainers
Readme
@lmliheng/android-adb
An Adelie plugin that packages one Skill: android-adb — drive an Android
phone over USB with adb from the shell.
It covers the half of the job that actually costs time:
- telling 「没插」「没授权」「掉线」 apart, and fixing each one properly;
- the git-bash trap where
/sdcard/...gets rewritten into a Windows path beforeadbever sees it (MSYS_NO_PATHCONV=1); - a minimal shell with no
sleep/seq/stat/which; - reading the screen when
uiautomator dumpreturns an empty tree — WeChat and WeCom do exactly that, so the way in is a screenshot plus image reading; - keeping a long transcript out of the model's context window by handing the screenshots to a subagent that writes text back.
What's in the box
plugin.json
package.json
icon.svg
LICENSE
README.md
skills/android-adb/
SKILL.md
scripts/ph.sh # ensure / shot / tap / swipe / key / text / launch / focus / size / dump
references/troubleshooting.mdInstall
The plugin targets category: office-productivity and ships with
preinstall: false, so it lands in the plugin library and is not pushed
into every Agent automatically.
Install from a zip upload — that is the path that has been tested most on this setup. (Every filename in this package is ASCII, so the npm tarball import works too; the PAX-header failure only hits packages with non-ASCII filenames.)
Use it
Once installed, the Skill is available as android-adb. At minimum you need
adb from Google's platform-tools and a phone with USB debugging enabled.
export MSYS_NO_PATHCONV=1
export ADB="C:/path/to/platform-tools/adb.exe"
sh ph.sh ensure # probe and repair, retrying up to 4 times
sh ph.sh shot out.png # screenshot
sh ph.sh tap 540 1200 # tap
sh ph.sh focus # which app is in the foregroundADB may be left unset — scripts/ph.sh falls back to a default path, which
you should change to wherever platform-tools actually lives.
Licence
MIT. See LICENSE.
