Documentation Index
Fetch the complete documentation index at: https://mintlify.com/new-silvermoon/awesome-android-agent-skills/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Android Emulator Skill provides a comprehensive suite of Python and Bash scripts for automating Android app testing, building, and interaction. Instead of relying on brittle pixel coordinates, it uses accessibility-driven navigation to interact with UI elements semantically (by text, resource ID, or content description). This skill is optimized for AI agents with minimal token output and structured JSON responses.When to Use This Skill
Invoke this skill when you need to:- Build and test Android apps programmatically
- Launch and interact with Android apps without manual tapping
- Navigate UI elements semantically (by text, ID, or class)
- Monitor app logs in real-time with intelligent filtering
- Perform automated testing workflows
- Manage emulator lifecycle (boot, shutdown, list AVDs)
- Debug app behavior through UI hierarchy inspection
Quick Start
Verify your environment and launch an app:--help for detailed options and --json for machine-readable output.
Script Reference
Build and Development
build_and_test.py
Wrapper around Gradle for building projects, running tests, and parsing results.
Usage:
- Parses build errors and test failures
- Supports
--cleanfor clean builds - JSON output for automated workflows
- Detects Gradle wrapper automatically
log_monitor.py
Real-time log monitoring with intelligent filtering and deduplication.
Usage:
- Filters by package, tag, PID, or priority (V, D, I, W, E, F)
- Deduplicates repeated log messages
- Optional time-limited monitoring with
--duration - Structured JSON output for parsing
Navigation and Interaction
screen_mapper.py
Analyzes the current screen and lists all interactive elements.
Usage:
- Parses UI hierarchy from
uiautomator dump - Identifies buttons, text fields, images, and clickable elements
- Shows resource IDs, text content, and content descriptions
- Foundation for semantic navigation
navigator.py
Finds and interacts with UI elements semantically.
Usage:
- Fuzzy text matching (case-insensitive, partial matches)
- Find by resource ID, class name, or text content
- Tap, long-press, and text entry actions
- JSON output with element coordinates
gesture.py
Performs swipes, scrolls, and other touch gestures.
Usage:
- Directional swipes (up, down, left, right)
- Customizable gesture duration
- Scroll actions for lists and scrollable content
- JSON output with gesture coordinates
keyboard.py
Sends key events and hardware button presses.
Usage:
HOME,BACK,ENTER,TAB,SPACEVOLUME_UP,VOLUME_DOWN,POWERMENU,SEARCH,CAMERA
app_launcher.py
Manages app lifecycle: launch, terminate, install, and uninstall.
Usage:
- Launch apps via
adb shell am start - Force-stop apps to reset state
- Install/uninstall APKs programmatically
- List all installed packages with
--list
Emulator Lifecycle Management
emulator_manage.py
Manages Android Virtual Devices (AVDs).
Usage:
- Lists all available AVDs with details
- Boots emulators in headless or GUI mode
- Gracefully shuts down running emulators
- JSON output for scripting
emu_health_check.sh
Verifies that the Android development environment is properly configured.
Usage:
- ADB installation and version
- Android Emulator availability
- Java/OpenJDK installation
- Gradle wrapper presence
ANDROID_HOMEenvironment variable- Connected devices and emulators
Common Patterns
Automated Login Flow
Build and Install Workflow
UI Testing Workflow
Auto-Device Detection
All scripts automatically target the single connected device or emulator. If multiple devices are connected, specify the target with:Output Formats
Scripts default to concise human-readable output. Use--json for machine-readable output:
Key Design Principles
Semantic Navigation
Find elements by meaning, not position:- Text content: “Login”, “Submit”, “Next”
- Resource IDs:
com.example.myapp:id/login_button - Content descriptions: Accessibility labels
- Element types:
Button,EditText,TextView
Token Efficiency
Minimize output verbosity for AI agents:- Concise default output
- Optional verbose mode with
--verbose - Structured JSON with
--jsonfor parsing
Zero Configuration
Works with standard Android SDK installations:- Detects
ANDROID_HOMEautomatically - Uses
adbfromPATHor SDK - Finds Gradle wrapper in project root
Requirements
- Android SDK Platform-Tools (adb, fastboot)
- Android Emulator
- Java / OpenJDK (for Gradle)
- Python 3 (for scripts)
Troubleshooting
Issue: “No devices detected”
Cause: No emulator or device connected Fix: Start emulator or connect physical device:Issue: “Element not found”
Cause: Text, ID, or type doesn’t match any element Fix: Usescreen_mapper.py to inspect current screen:
Issue: “UI hierarchy dump failed”
Cause: App has accessibility services disabled or UI is loading Fix: Wait for UI to stabilize, then retry:Issue: “Multiple devices connected”
Cause: Multiple emulators or devices detected Fix: Specify target device with-s:
Best Practices
- Always run
emu_health_check.shbefore starting automation - Use
screen_mapper.pyto discover element IDs before scripting - Prefer resource IDs over text for stable element targeting
- Add delays (
sleep) between interactions for UI stability - Use
--jsonoutput for parsing in automated workflows - Monitor logs with
log_monitor.pyduring debugging - Target specific devices with
-sin multi-device setups - Terminate apps with
app_launcher.py --terminateto reset state between tests
