Skip to main content 首页 创作者 rdmptv adbautoplayer moai-domain-adb
moai-domain-adb Comprehensive ADB (Android Debug Bridge) automation skill for game bot development,
device management, computer vision integration, and Tauri-Python orchestration.
Provides modular expertise for building intelligent Android automation workflows.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rdmptv/AdbAutoPlayer --skill moai-domain-adb命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... COMMON-UTILS-QUICKREF.md 8.1 KB DELIVERABLES-INDEX.md 14.8 KB MULTIRESOLUTION-FILE-INDEX.md 16.0 KB MULTIRESOLUTION-MATCHING-SUMMARY.md 15.7 KB MULTIRESOLUTION-QUICKREF.md 8.4 KB PHASE_9B_WORKSTREAM_C_COMPLETION.md 22.3 KB PHASE-11-RESILIENCE-SUMMARY.md 18.2 KB PHASE-5-FOUNDATION-REPORT.md 12.9 KB PHASE-5-SUMMARY.txt 8.7 KB PHASE-9B-COMPLETION-REPORT.md 18.4 KB PHASE-9B-WORKSTREAM-B-SUMMARY.md 16.9 KB RESILIENCE-QUICKREF.md 11.5 KB name moai-domain-adb title ADB Automation Domain Specialist version 1.0.0 tier 3 category domain-specialist color yellow status active created "2025-12-01T00:00:00.000Z" maintainer MoAI-ADK Community description Comprehensive ADB (Android Debug Bridge) automation skill for game bot development,
device management, computer vision integration, and Tauri-Python orchestration.
Provides modular expertise for building intelligent Android automation workflows.
requires_skills ["moai-lang-unified","moai-foundation-core"] scripts_manifest ["adb_device_analyzer.py","adb_bot_generator.py","adb_template_creator.py","adb_performance_profiler.py","adb_config_validator.py","adb_game_tester.py","adb_deployment_helper.py"] modules ["adb-fundamentals","device-management","game-automation","computer-vision","tauri-integration"] tags ["android","automation","game-bot","device-management","computer-vision","tauri","adb-cli","testing"]
moai-domain-adb: ADB Automation Domain Specialist
Tier 3 Modularized Skill for intelligent Android automation, game bot development, and real-time device orchestration.
🎯 Quick Reference
Core Competencies
Domain Capability Module Device Control ADB connection, shell execution, property inspection adb-fundamentals Device Management Multi-device orchestration, state tracking, lifecycle device-management Game Automation Bot scripting, action sequences, timing control game-automation Vision & Detection Template matching, OCR, region-based detection computer-vision Tauri Integration UI-Python bridge, real-time communication, deployment tauri-integration
Key Functions (Quick Access)
Device Operations
adb devices --list -long
adb shell input tap 540 960
adb shell getprop ro.build.version.sdk
adb install -r game.apk
Bot Control
adb shell am start -n com.game/.MainActivity
adb shell input tap x y && sleep 1 && adb shell input tap x2 y2
adb shell screencap -p /sdcard/screen.png
Module Selection Guide
Use when you need to...
Device discovery, property reading, system interaction
Manage multiple devices : Load device-management module
Device state tracking, connection pooling, failover strategies
Batch operations, monitoring, lifecycle management
Develop game bots : Load game-automation module
Click sequences, timing, OCR parsing, state detection
Custom routines, action templates, bot patterns
Use vision for detection : Load computer-vision module
Template matching (OpenCV), OCR (Tesseract)
Region-based detection, image analysis, pattern recognition
Integrate with Tauri UI : Load tauri-integration module
Real-time bot status updates, command queueing
UI ↔ Python communication, resource management
📚 Implementation Guide
Architecture Overview moai-domain-adb follows a 5-module progressive disclosure pattern:
moai-domain-adb/
├── SKILL.md # This file (documentation hub)
├── modules/
│ ├── adb-fundamentals.md # Level 1: Core ADB operations
│ ├── device-management.md # Level 2: Multi-device orchestration
│ ├── game-automation.md # Level 3: Bot development patterns
│ ├── computer-vision.md # Level 4: Vision-based detection
│ └── tauri-integration.md # Level 5: UI orchestration
└── scripts/ # IndieDevDan UV scripts
├── adb_device_analyzer.py # Analyze device capabilities
├── adb_bot_generator.py # Generate bot skeletons
├── adb_template_creator.py # Create action templates
├── adb_performance_profiler.py # Profile bot performance
├── adb_config_validator.py # Validate configurations
├── adb_game_tester.py # Test bot on devices
└── adb_deployment_helper.py # Deploy to production
Tier 3 Characteristics ✅ Modularized : 5 independent modules (no cross-module imports)
✅ Production-Ready : 500+ line SKILL.md with comprehensive docs
✅ Scripted : 7 UV scripts following IndieDevDan 13 rules
✅ Delegatable : Works with expert-* and manager-* agents
✅ Reusable : Applicable to any Android automation project
Usage Pattern
Integration Points
adb-bot-runner: Executes bots using game-automation patterns
adb-device-manager: Manages devices using device-management expertise
adb-game-tester: Tests bots using computer-vision and game-automation
adb-config-manager: Validates configs using config-validator script
adb-workflow-orchestrator: Coordinates all agents using tauri-integration patterns
/adb:init → Uses adb-fundamentals + adb_device_analyzer
/adb:bot → Uses game-automation + adb_bot_generator
/adb:test → Uses computer-vision + adb_game_tester
/adb:deploy → Uses tauri-integration + adb_deployment_helper
With UV Scripts :
All 7 scripts are self-contained (zero dependencies on each other), follow PEP 723, and implement dual output (human-readable + JSON).
Progressive Disclosure Strategy
Read: adb-fundamentals module
Run: adb_device_analyzer.py to list devices
Understand: Basic device connection and property reading
Level 2: Multi-Device Workflows
Read: device-management module
Understand: Connection pooling, state tracking, failover
Build: Scripts that manage 5+ devices simultaneously
Level 3: Game Bot Development
Read: game-automation module
Understand: Click sequences, timing control, OCR integration
Build: Custom routines for game-specific tasks
Level 4: Vision-Based Automation
Read: computer-vision module
Understand: Template matching, OCR parsing, region detection
Build: Bots that adapt to UI changes dynamically
Level 5: Production Orchestration
Read: tauri-integration module
Understand: Real-time UI updates, command queuing, resource management
Build: Enterprise workflows with Tauri UI control
🚀 Advanced Topics
Skill Composition Strategy moai-domain-adb is designed for modular composition:
agent = Task(
subagent_type="expert-backend" ,
prompt="Use moai-domain-adb:adb-fundamentals to list ADB devices"
)
agent = Task(
subagent_type="adb-workflow-orchestrator" ,
prompt="Deploy game bot to 3 devices"
)
agent = Task(
subagent_type="adb-game-tester" ,
prompt="Test bot with computer vision verification"
)
Performance Optimization
Group commands by device to reduce round-trip latency
Use adb_performance_profiler.py to identify bottlenecks
Target: Execute 100 actions in <5 seconds
Cache device properties (refreshed every 60s)
Cache template images (refreshed on detection failure)
Cache bot configurations (invalidated on user edit)
Run multi-device operations with ThreadPoolExecutor
Limit to 5 concurrent ADB operations per host
Use queuing for >5 devices
Security Considerations
ADB uses RSA key exchange; validate device certificates
Never store unencrypted device pairing keys
Rotate pairing keys quarterly for production devices
Request minimal shell commands (avoid su unless necessary)
Use app-specific commands instead of root access
Audit bot actions for unintended side effects
Never capture sensitive data in screenshots
Encrypt stored configurations containing API keys
Use secure storage for game credentials
Debugging & Troubleshooting Issue Diagnosis Solution Device not found adb_device_analyzer.py --check-connectionVerify USB connection, check ADB daemon Slow bot execution adb_performance_profiler.py --device <id>Reduce click delays, batch operations Template matching fails Check image DPI/resolution Run adb_template_creator.py --device <id> OCR accuracy poor Preprocess image (contrast, threshold) See computer-vision module for tips Tauri communication lag Check Python process CPU Reduce log verbosity, optimize render loop
export ADB_DEBUG=1
uv run .claude/skills/moai-domain-adb/scripts/adb_device_analyzer.py --verbose
adb logcat | grep "adb_bot_runner"
Testing Strategy (TRUST 5 Framework) Test Coverage Target : ≥85%
Unit Tests : Individual module functions (py.test)
Integration Tests : Module interactions (device mock)
E2E Tests : Full workflow with real devices (optional)
Performance Tests : Execution time benchmarks
Security Tests : Input validation, permission checks
pytest tests/ -v --cov=.claude/skills/moai-domain-adb
pytest tests/test_device_management.py -v
pytest tests/ --benchmark-only
📖 Module Navigation Each module builds upon previous knowledge but is independently usable:
adb-fundamentals (250 lines)
ADB architecture, connection protocols, device discovery
Shell execution, property reading, device interaction
device-management (280 lines)
Multi-device orchestration, state tracking, connection pooling
Lifecycle management, monitoring, failover strategies
game-automation (300 lines)
Bot scripting patterns, click sequences, timing control
OCR integration, state detection, action templates
computer-vision (270 lines)
Template matching (OpenCV), OCR (Tesseract)
Region detection, image preprocessing, pattern recognition
tauri-integration (240 lines)
Tauri-Python IPC, real-time updates, command queueing
Resource management, deployment strategies, monitoring
🛠️ Scripts & Tools All scripts follow IndieDevDan 13 Rules (PEP 723, 9-section structure, dual output):
uv run scripts/adb_device_analyzer.py --device emulator-5554 --json
uv run scripts/adb_bot_generator.py --game "My Game" --output my_bot.py
uv run scripts/adb_template_creator.py --screenshot screen.png --region "0,0,1080,1920"
uv run scripts/adb_performance_profiler.py --bot bot.py --iterations 100
uv run scripts/adb_config_validator.py --config config.yaml --strict
uv run scripts/adb_game_tester.py --bot bot.py --device emulator-5554
uv run scripts/adb_deployment_helper.py --bot bot.py --target production
Complete Scripts Reference (36 scripts) All scripts are located in scripts/ directory and organized by category. Each script supports:
--device/-d - Specify device ID (defaults to first connected)
--toon - Output in TOON/YAML format for automation
--verbose/-v - Enable verbose logging
--help - Show detailed help and usage examples
🔌 Connection (4 scripts) Location : scripts/connection/
Script Purpose Key Options Example adb_connect.pyConnect to device via IP:port --device (default: 127.0.0.1:5555)uv run scripts/connection/adb_connect.pyadb_disconnect.pyDisconnect device gracefully --deviceuv run scripts/connection/adb_disconnect.pyadb_restart_server.pyRestart ADB server --verboseuv run scripts/connection/adb_restart_server.pyadb_device_status.pyList all devices and status --toonuv run scripts/connection/adb_device_status.py
📱 Screen (6 scripts) Location : scripts/screen/
Script Purpose Key Options Example adb_screenshot.pyCapture screenshot --output FILEuv run scripts/screen/adb_screenshot.py --output capture.pngadb_tap.pyTap at coordinates --x X --y Y --count Nuv run scripts/screen/adb_tap.py --x 500 --y 1000adb_swipe.pySwipe gesture --preset {up,down,left,right} or --start X,Y --end X,Yuv run scripts/screen/adb_swipe.py --preset upadb_keyevent.pySend key event --key {back,home,menu,power,volume_up}uv run scripts/screen/adb_keyevent.py --key backadb_text_input.pyType text --text TEXTuv run scripts/screen/adb_text_input.py --text "Hello"adb_screenrecord.pyRecord screen video --output FILE --duration SECONDSuv run scripts/screen/adb_screenrecord.py --duration 60
📦 App (5 scripts) Script Purpose Key Options Example adb_app_list.pyList installed apps --filter TEXT, --system, --alluv run scripts/app/adb_app_list.py --filter afkadb_app_start.pyStart app by package -p PACKAGE, --waituv run scripts/app/adb_app_start.py -p com.afk.journeyadb_app_stop.pyForce stop app -p PACKAGEuv run scripts/app/adb_app_stop.py -p com.afk.journeyadb_app_install.pyInstall APK --apk FILEuv run scripts/app/adb_app_install.py --apk game.apkadb_app_uninstall.pyUninstall app -p PACKAGE, --keep-datauv run scripts/app/adb_app_uninstall.py -p com.example
ℹ️ Info (4 scripts) Script Purpose Key Options Example adb_device_info.pyDevice specifications --toonuv run scripts/info/adb_device_info.pyadb_display_info.pyDisplay resolution/DPI --toonuv run scripts/info/adb_display_info.pyadb_running_app.pyCurrent foreground app --toonuv run scripts/info/adb_running_app.pyadb_battery_info.pyBattery status --toonuv run scripts/info/adb_battery_info.py
⚡ Performance (3 scripts) Location : scripts/performance/
Script Purpose Key Options Example adb_cpu_monitor.pyReal-time CPU monitoring --duration SECONDS, --package PKGuv run scripts/performance/adb_cpu_monitor.py --duration 60adb_memory_monitor.pyMemory usage monitoring --duration SECONDS, --package PKGuv run scripts/performance/adb_memory_monitor.py --duration 60adb_logcat_filter.pyFilter logcat logs --tag TAG, --priority {V,D,I,W,E,F}, --followuv run scripts/performance/adb_logcat_filter.py --tag MyApp --priority E
🤖 Automation (4 scripts) Location : scripts/automation/
Script Purpose Key Options Example adb_game_loop.pyExecute repeating sequence -s FILE, -l LOOPS, --infiniteuv run scripts/automation/adb_game_loop.py -s daily.json -l 10adb_wait_for_app.pyWait for app to start --package PKG, --timeout SECONDSuv run scripts/automation/adb_wait_for_app.py -p com.afk.journeyadb_click_sequence.pyExecute sequence once -s FILEuv run scripts/automation/adb_click_sequence.py -s tutorial.jsonadb_screenshot_compare.pyCompare screenshots -b BEFORE -a AFTER, --threshold FLOATuv run scripts/automation/adb_screenshot_compare.py -b ref.png -a test.png
🛠️ Utils (3 scripts) Script Purpose Key Options Example adb_shell.pyExecute shell commands -c COMMAND, --timeout SECONDSuv run scripts/utils/adb_shell.py -c "ls /sdcard"adb_push.pyPush file to device -l LOCAL -r REMOTEuv run scripts/utils/adb_push.py -l file.txt -r /sdcard/adb_pull.pyPull file from device -r REMOTE -l LOCALuv run scripts/utils/adb_pull.py -r /sdcard/screenshot.png -l .
🔧 Monitoring (7 scripts) Location : scripts/ (root level)
Script Purpose Key Options Example adb_bot_generator.pyGenerate bot scripts --template NAME, --output FILEuv run scripts/adb_bot_generator.py --template daily_questsadb_config_validator.pyValidate configs --config FILE, --strictuv run scripts/adb_config_validator.py --config config.jsonadb_deployment_helper.pyDeploy to devices --apk FILE, --all, --devices IDSuv run scripts/adb_deployment_helper.py --apk game.apk --alladb_device_analyzer.pyAnalyze capabilities --aspects LIST, --output FILEuv run scripts/adb_device_analyzer.py --aspects performance,batteryadb_game_tester.pyTest game automation --test-suite FILE, --screenshotsuv run scripts/adb_game_tester.py --test-suite tests.jsonadb_performance_profiler.pyProfile performance --package PKG, --duration SECONDSuv run scripts/adb_performance_profiler.py -p com.afk.journeyadb_template_creator.pyCreate templates --name NAME, --category CATuv run scripts/adb_template_creator.py --name my_automation
JSON Sequence Format (Automation Scripts) For adb_game_loop.py and adb_click_sequence.py, use JSON format:
{
"name" : "Daily Quest Automation" ,
"steps" : [
{ "action" : "tap" , "x" : 500 , "y" : 1000 , "delay" : 2 } ,
{ "action" : "swipe" , "start" : [ 500 , 1500 ] , "end" : [ 500 , 500 ] , "duration" : 300 } ,
{ "action" : "wait" , "duration" : 3 } ,
{ "action" : "screenshot" , "output" : "/tmp/check.png" } ,
{ "action" : "keyevent" , "key" : "back" } ,
{ "action" : "text_input" , "text" : "Hello World" }
]
}
Supported Actions : tap, swipe, wait, screenshot, keyevent, text_input
Common Utilities All scripts use shared utilities from scripts/common/:
adb_utils.py - ADB device operations and connection management
cli_utils.py - Click decorators, Rich formatters, output helpers
error_handlers.py - Standardized error handling and exit codes (0, 2, 3, 4)
path_utils.py - Project root detection and path resolution
Exit Codes All scripts use standardized exit codes:
0 - Success
2 - Device offline or not found
3 - ADB command failed or execution error
4 - Invalid argument or configuration
Output Formats Text Output (default): Rich-formatted console output with colors and tables
TOON Output (--toon): YAML/structured format for automation and parsing
📞 Support & References
Modules : See individual module files in modules/
Scripts : See individual scripts in scripts/ with --help
Examples : See integration patterns in adb-* agents
Tests : See test suite in tests/
Version : 1.0.0
Status : ✅ Production Ready (Phase 1 Foundation)
Last Updated : 2025-12-01
Next Phase : Create 5 core modules + 7 UV scripts