用途:为 Android 自动化提供屏幕理解能力,在执行操作前后验证界面状态,按文字或外观定位 UI 元素,构建可靠的自动化流程。
主要能力:ADB 截图并本地保存;基于 Tesseract 的 OCR 文字提取;基于 OpenCV 的模板匹配元素检测;ADB 坐标点击并支持点击后文字校验。
使用方式:包含四个可独立运行、可串联的脚本,均支持 JSON 输出。 截图:uv run .claude/skills/adb-screen-detection/scripts/adb-screen-capture.py,可用 --device、--output、--json。 OCR:uv run .claude/skills/adb-screen-detection/scripts/adb-ocr-extract.py,可用 --image、--search、--json。 查找元素:uv run .claude/skills/adb-screen-detection/scripts/adb-find-element.py --method ocr --target "Login" --threshold 0.8,或 --method template --template /path/to/template.png。 点击:uv run .claude/skills/adb-screen-detection/scripts/adb-tap-coordinate.py --x 100 --y 200 --verify-text "Next Screen" --timeout 5。
适用场景:需要先验证 UI 状态再操作、按文字或图像查找元素、构建依赖屏幕判断的自动化工作流。
依赖与限制:需系统安装 adb 命令行工具,Python 依赖 pytesseract、opencv-python、pillow、numpy;OCR 需安装 Tesseract 并可能需设置 TESSDATA_PREFIX。模板匹配阈值 0.0-1.0,建议 0.8-0.9。设备离线时可用 adb devices、adb connect、adb kill-server && adb start-server 排查。工作流采用 TOON 定义,位于 workflow/ 目录,可通过 adb-workflow-orchestrator 运行。