{"owner":"openatx","repo":"uiautomator2","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":3062,"categories":["copilot-instructions","anthropic-skill","claude-rule"],"hasMcp":false,"mcpConfig":null,"found":[".github/copilot-instructions.md","skills/uiautomator2/SKILL.md","Claude.md"],"skills":{".github/copilot-instructions.md":"# uiautomator2\n\nuiautomator2 is a Python library providing a simple, easy-to-use, and stable Android automation framework. It consists of a Python client that communicates with an HTTP service running on Android devices based on UiAutomator.\n\n**ALWAYS follow these instructions first and completely. Only fallback to additional search and context gathering if the information in these instructions is incomplete or found to be in error.**\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Initial Setup\n- `pip install poetry` -- Install Poetry dependency manager\n- `poetry install` -- Install all dependencies in virtual environment. NEVER CANCEL: Takes 3-5 minutes. Set timeout to 8+ minutes.\n- Poetry will create a virtual environment in `.venv/` directory\n\n### Build and Test Process\n- `poetry run pytest tests/ -v` -- Run unit tests (25 tests). Takes ~3 seconds. All tests should pass.\n- `make cov` -- Run coverage tests. Takes ~3 seconds. Should show ~27% coverage.\n- `make format` -- Format code with isort. Takes ~1 second. ALWAYS run before committing.\n- `poetry build` -- Build distribution packages. Takes ~5 seconds. Creates wheel and sdist in `dist/`.\n- `poetry run uiautomator2 version` -- Check CLI functionality. Should output version number.\n\n### Asset Synchronization (Optional)\n- `make sync` -- Download required APK and JAR assets. FAILS due to network restrictions in sandboxed environment. This is EXPECTED and not required for development.\n- Asset sync downloads Android APK and u2.jar from external hosts which are blocked in this environment.\n\n### Commands That Will Fail (Expected)\n- `make test` -- Mobile tests require Android device via ADB. Will fail with \"Can't find any android device/emulator\" - this is EXPECTED.\n- `make build` -- Full build with poetry plugin. May fail due to system package conflicts. Use `poetry build` instead.\n- `make sync` -- Asset download fails due to network restrictions. Not required for core development.\n\n## Validation Scenarios\n\nAfter making changes, ALWAYS run this validation sequence:\n\n1. **Unit Tests**: `poetry run pytest tests/ -v` -- Must pass all 25 tests\n2. **Coverage**: `make cov` -- Should complete without errors\n3. **Formatting**: `make format` -- Always format before committing  \n4. **Build**: `poetry build` -- Must complete successfully\n5. **CLI Test**: `poetry run uiautomator2 --help` -- Should show help output\n\n### Manual Testing Scenarios\n- Test version command: `poetry run uiautomator2 version`\n- Test CLI help: `poetry run uiautomator2 --help`\n- Verify core imports: `poetry run python -c \"import uiautomator2; print('Import successful')\"`\n\n## Key Components and Structure\n\n### Core Modules (uiautomator2/)\n- `__init__.py` -- Main API and connection functions (426 lines, 27% coverage)\n- `xpath.py` -- XPath selector implementation (411 lines, 62% coverage)  \n- `_selector.py` -- UI element selectors (320 lines, 19% coverage)\n- `core.py` -- Core device interaction (214 lines, 21% coverage)\n- `watcher.py` -- Event watchers (212 lines, 20% coverage)\n\n### Test Directories\n- `tests/` -- Unit tests (25 tests, no device required)\n- `mobile_tests/` -- Integration tests (30 tests, require Android device)\n- `demo_tests/` -- Example/demo tests\n\n### Build Configuration\n- `pyproject.toml` -- Poetry configuration and dependencies\n- `Makefile` -- Build automation (format, test, build, sync commands)\n- `.coveragerc` -- Coverage configuration\n\n### Additional Components\n- `uibox/` -- Go component for Android binary tools (separate build system)\n\n### Documentation\n- `README.md` -- Main documentation with usage examples\n- `DEVELOP.md` -- Development setup instructions\n- `XPATH.md` -- XPath selector documentation\n- `CHANGELOG` -- Version history\n\n## Common Development Tasks\n\n### Adding New Features\n1. Run existing tests to ensure baseline: `poetry run pytest tests/ -v`\n2. Implement changes in appropriate module under `uiautomator2/`\n3. Add unit tests in `tests/` directory\n4. Run tests: `poetry run pytest tests/ -v`\n5. Format code: `make format`\n6. Check coverage: `make cov`\n7. Build to verify: `poetry build`\n\n### Debugging Issues\n- Enable debug logging: Use `-d` flag with CLI commands\n- Check import issues: `poetry run python -c \"import uiautomator2\"`\n- Device connection issues require actual Android device (expected to fail in this environment)\n\n### Code Style\n- Uses isort for import sorting with HANGING_INDENT mode and 120 character line length\n- Coverage requirement: Tests should maintain or improve the ~27% coverage baseline\n- All code must pass existing unit tests\n\n## Environment Limitations\n\n**CANNOT DO (Expected Failures):**\n- Mobile testing without Android device\n- Asset synchronization (network blocked)\n- Full make build (dependency conflicts)\n\n**CAN DO:**\n- Unit testing (tests/ directory)\n- Code formatting and linting\n- Building with `poetry build`\n- CLI testing and development\n- Core library development\n\n## Time Expectations\n\n- **NEVER CANCEL**: Poetry install takes 3-5 minutes. Set timeout to 8+ minutes.\n- Unit tests: ~2.5 seconds\n- Coverage tests: ~3.5 seconds  \n- Code formatting: ~0.5 seconds\n- Poetry build: ~3 seconds\n- Full validation sequence: ~12 seconds\n\n## Key Commands Reference\n\n```bash\n# Essential development workflow\npoetry install                    # Setup (3-5 min, NEVER CANCEL)\npoetry run pytest tests/ -v       # Unit tests (2.5s)\nmake format                       # Format (0.5s) \nmake cov                          # Coverage (3.5s)\npoetry build                      # Build (3s)\n\n# CLI testing\npoetry run uiautomator2 version   # Version check\npoetry run uiautomator2 --help    # Help system\n\n# Known failures (expected in sandboxed environment)\nmake test                         # Requires Android device\nmake sync                         # Network blocked\nmake build                        # Dependency conflicts\n```\n\nAlways validate changes with the full sequence: tests → format → coverage → build → CLI test.\n\n## Validation Guarantee\n\n**Every command in these instructions has been validated to work correctly.** If any command fails unexpectedly:\n\n1. First check that you're in the correct directory: `/path/to/uiautomator2`\n2. Ensure Poetry virtual environment is properly set up: `poetry install`\n3. Check for environment issues: `poetry run python -c \"import uiautomator2; print('OK')\"`\n4. If problems persist, the issue may be with your environment or changes you've made\n\nExpected validation results:\n- Unit tests: 25 tests should pass\n- Coverage: Should show ~27% total coverage  \n- Format: Should complete without errors (may show \"Skipped N files\")\n- Build: Should create `dist/` directory with wheel and sdist\n- CLI: Should display help text starting with \"usage: uiautomator2\"","skills/uiautomator2/SKILL.md":"---\nname: uiautomator2\ndescription: >\n  Android device automation via uiautomator2. Use this skill whenever the user wants to\n  click/tap elements, swipe screens, start or stop apps, press hardware keys, type text,\n  take screenshots, inspect UI hierarchy, or perform any actions on an Android device.\n---\n\n# uiautomator2\n\nThis skill helps you automate Android devices using the `u2cli` provided by the `uiautomator2` Python package.\n\n## General Usage\n\n- Use `u2cli <command> [args]` to run commands.\n- Use `u2cli -s <serial> <command> [args]` when multiple Android devices are connected.\n- Examples below show only `<command> [args]`; prepend `u2cli` when running them.\n\n## Commands\n\n### Device Commands\n\n- `dump-hierarchy`: Dump current UI hierarchy for analysis and element selection. Prefer the default output first because u2cli compresses it before returning, which is usually enough and works well with `grep`, for example `dump-hierarchy | grep -i \"keyword\"`. Only use `dump-hierarchy --raw` when you explicitly need the full uncompressed hierarchy.\n- `screenshot`: Capture current screen and save to a local file. The output is the file path and size of the screenshot. Example: `screenshot /tmp/screenshot.jpg`.\n- `app-current`: Get the current foreground app package name and activity.\n- `device-info`: Show device information.\n- `window-size`: Show screen window size.\n- `shell`: Run a shell command on the device. Use `--timeout <seconds>` to set command timeout. Example: `shell \"pm list packages\"`.\n\n### App Commands\n\n- `app-start`: Start an application by package name. Options: `--activity <activity>`, `--wait`, `--stop`. Example: `app-start com.android.settings --activity .Settings --wait`.\n- `app-list`: List installed packages.\n- `app-stop`: Stop an application by package name. Example: `app-stop com.example.app`.\n- `app-install`: Install an APK. Example: `app-install ./app-debug.apk`.\n- `app-uninstall`: Uninstall an application by package name. Example: `app-uninstall com.example.app`.\n- `app-clear`: Clear application data by package name. Example: `app-clear com.example.app`.\n\n### Input Commands\n\n- `press`: Press a hardware or Android key. Example: `press home`.\n- `send-keys`: Type text into the focused input. By default it clears before typing; use `--no-clear` to preserve existing text. Example: `send-keys \"hello world\"`.\n- `clear-text`: Clear focused input text. Example: `clear-text`.\n- `click`: Click coordinates or a selector. Use `X Y` for coordinates, or selector options like `--text`, `--resource-id`, `--description`, and `--class-name`. Example: `click 500 1200`; ratio example: `click 0.5 0.5`; selector example: `click --text Gmail`.\n- `double-click`: Double click coordinates. Options: `--duration <seconds>` for the delay between taps. This command requires `X Y`; selector options are not supported. Example: `double-click 500 1200`; ratio example: `double-click 0.5 0.5`.\n- `long-click`: Long click coordinates or a selector. Options: `--duration <seconds>` and `--timeout <seconds>`. Example: `long-click 500 1200`; ratio example: `long-click 0.5 0.5`; selector example: `long-click --text Gmail`.\n- `swipe`: Swipe from one coordinate to another. Arguments are `FX FY TX TY`. Options: `--duration <seconds>`, `--steps <number>`, `--scale <number>`. Example: `swipe 500 1800 500 400 --duration 0.3`; ratio example: `swipe 0.5 0.8 0.5 0.2 --duration 0.3`.\n- `drag`: Drag from one coordinate to another. Arguments are `SX SY EX EY`. Options: `--duration <seconds>`. Example: `drag 300 1200 800 1200`; ratio example: `drag 0.3 0.5 0.8 0.5`.\n\n### Selector Commands\n\n- `exists`: Check whether a selector exists. Options: `--timeout <seconds>` plus selector options. Example: `exists --text Gmail --timeout 3`.\n- `wait`: Wait for a selector to appear. Use `--gone` to wait until it disappears. Options: `--timeout <seconds>` plus selector options. Example: `wait --text Gmail --timeout 10`; gone example: `wait --text Loading --gone --timeout 10`.\n- `scroll`: Scroll a selector. Options: `--direction vert|horiz`, `--action forward|backward|toEnd|toBeginning`, `--max-swipes <number>`, `--to-text <text>`, plus selector options. Example: `scroll --scrollable --direction vert --action forward`; scroll-to-text example: `scroll --scrollable --to-text Settings`.\n\n### System UI Commands\n\n- `open-notification`: Open the notification shade.\n- `open-quick-settings`: Open quick settings.\n- `open-url`: Open a URL on the device. Example: `open-url https://example.com`.\n\n### Common Selector Options\n\nUse these options with selector-based commands such as `click`, `long-click`, `exists`, `wait`, and `scroll`.\n\n- Text selectors: `--text <text>`, `--text-contains <text>`, `--text-matches <regex>`, `--text-starts-with <text>`.\n- Description selectors: `--description <text>`, `--description-contains <text>`.\n- Resource and class selectors: `--resource-id <id>`, `--class-name <class>`, `--package <package>`.\n- State selectors: `--selected`, `--focused`, `--enabled`, `--scrollable`, `--clickable`, `--checked`, `--checkable`.\n- Position selectors: `--instance <number>`, `--index <number>`.\n- Child selectors: use `--child KEY=VALUE [KEY=VALUE ...]` or child-specific options like `--child-text`, `--child-resource-id`, `--child-class-name`, `--child-clickable`, and `--child-index` to append a child selector level. Example: `click --resource-id com.example:id/list --child text=OK`.\n","Claude.md":"代码要兼容Python3.8\n不允许出现 value: str | None 这种要换成 value: Optional[str]\n"},"files":{".github/copilot-instructions.md":"# uiautomator2\n\nuiautomator2 is a Python library providing a simple, easy-to-use, and stable Android automation framework. It consists of a Python client that communicates with an HTTP service running on Android devices based on UiAutomator.\n\n**ALWAYS follow these instructions first and completely. Only fallback to additional search and context gathering if the information in these instructions is incomplete or found to be in error.**\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Initial Setup\n- `pip install poetry` -- Install Poetry dependency manager\n- `poetry install` -- Install all dependencies in virtual environment. NEVER CANCEL: Takes 3-5 minutes. Set timeout to 8+ minutes.\n- Poetry will create a virtual environment in `.venv/` directory\n\n### Build and Test Process\n- `poetry run pytest tests/ -v` -- Run unit tests (25 tests). Takes ~3 seconds. All tests should pass.\n- `make cov` -- Run coverage tests. Takes ~3 seconds. Should show ~27% coverage.\n- `make format` -- Format code with isort. Takes ~1 second. ALWAYS run before committing.\n- `poetry build` -- Build distribution packages. Takes ~5 seconds. Creates wheel and sdist in `dist/`.\n- `poetry run uiautomator2 version` -- Check CLI functionality. Should output version number.\n\n### Asset Synchronization (Optional)\n- `make sync` -- Download required APK and JAR assets. FAILS due to network restrictions in sandboxed environment. This is EXPECTED and not required for development.\n- Asset sync downloads Android APK and u2.jar from external hosts which are blocked in this environment.\n\n### Commands That Will Fail (Expected)\n- `make test` -- Mobile tests require Android device via ADB. Will fail with \"Can't find any android device/emulator\" - this is EXPECTED.\n- `make build` -- Full build with poetry plugin. May fail due to system package conflicts. Use `poetry build` instead.\n- `make sync` -- Asset download fails due to network restrictions. Not required for core development.\n\n## Validation Scenarios\n\nAfter making changes, ALWAYS run this validation sequence:\n\n1. **Unit Tests**: `poetry run pytest tests/ -v` -- Must pass all 25 tests\n2. **Coverage**: `make cov` -- Should complete without errors\n3. **Formatting**: `make format` -- Always format before committing  \n4. **Build**: `poetry build` -- Must complete successfully\n5. **CLI Test**: `poetry run uiautomator2 --help` -- Should show help output\n\n### Manual Testing Scenarios\n- Test version command: `poetry run uiautomator2 version`\n- Test CLI help: `poetry run uiautomator2 --help`\n- Verify core imports: `poetry run python -c \"import uiautomator2; print('Import successful')\"`\n\n## Key Components and Structure\n\n### Core Modules (uiautomator2/)\n- `__init__.py` -- Main API and connection functions (426 lines, 27% coverage)\n- `xpath.py` -- XPath selector implementation (411 lines, 62% coverage)  \n- `_selector.py` -- UI element selectors (320 lines, 19% coverage)\n- `core.py` -- Core device interaction (214 lines, 21% coverage)\n- `watcher.py` -- Event watchers (212 lines, 20% coverage)\n\n### Test Directories\n- `tests/` -- Unit tests (25 tests, no device required)\n- `mobile_tests/` -- Integration tests (30 tests, require Android device)\n- `demo_tests/` -- Example/demo tests\n\n### Build Configuration\n- `pyproject.toml` -- Poetry configuration and dependencies\n- `Makefile` -- Build automation (format, test, build, sync commands)\n- `.coveragerc` -- Coverage configuration\n\n### Additional Components\n- `uibox/` -- Go component for Android binary tools (separate build system)\n\n### Documentation\n- `README.md` -- Main documentation with usage examples\n- `DEVELOP.md` -- Development setup instructions\n- `XPATH.md` -- XPath selector documentation\n- `CHANGELOG` -- Version history\n\n## Common Development Tasks\n\n### Adding New Features\n1. Run existing tests to ensure baseline: `poetry run pytest tests/ -v`\n2. Implement changes in appropriate module under `uiautomator2/`\n3. Add unit tests in `tests/` directory\n4. Run tests: `poetry run pytest tests/ -v`\n5. Format code: `make format`\n6. Check coverage: `make cov`\n7. Build to verify: `poetry build`\n\n### Debugging Issues\n- Enable debug logging: Use `-d` flag with CLI commands\n- Check import issues: `poetry run python -c \"import uiautomator2\"`\n- Device connection issues require actual Android device (expected to fail in this environment)\n\n### Code Style\n- Uses isort for import sorting with HANGING_INDENT mode and 120 character line length\n- Coverage requirement: Tests should maintain or improve the ~27% coverage baseline\n- All code must pass existing unit tests\n\n## Environment Limitations\n\n**CANNOT DO (Expected Failures):**\n- Mobile testing without Android device\n- Asset synchronization (network blocked)\n- Full make build (dependency conflicts)\n\n**CAN DO:**\n- Unit testing (tests/ directory)\n- Code formatting and linting\n- Building with `poetry build`\n- CLI testing and development\n- Core library development\n\n## Time Expectations\n\n- **NEVER CANCEL**: Poetry install takes 3-5 minutes. Set timeout to 8+ minutes.\n- Unit tests: ~2.5 seconds\n- Coverage tests: ~3.5 seconds  \n- Code formatting: ~0.5 seconds\n- Poetry build: ~3 seconds\n- Full validation sequence: ~12 seconds\n\n## Key Commands Reference\n\n```bash\n# Essential development workflow\npoetry install                    # Setup (3-5 min, NEVER CANCEL)\npoetry run pytest tests/ -v       # Unit tests (2.5s)\nmake format                       # Format (0.5s) \nmake cov                          # Coverage (3.5s)\npoetry build                      # Build (3s)\n\n# CLI testing\npoetry run uiautomator2 version   # Version check\npoetry run uiautomator2 --help    # Help system\n\n# Known failures (expected in sandboxed environment)\nmake test                         # Requires Android device\nmake sync                         # Network blocked\nmake build                        # Dependency conflicts\n```\n\nAlways validate changes with the full sequence: tests → format → coverage → build → CLI test.\n\n## Validation Guarantee\n\n**Every command in these instructions has been validated to work correctly.** If any command fails unexpectedly:\n\n1. First check that you're in the correct directory: `/path/to/uiautomator2`\n2. Ensure Poetry virtual environment is properly set up: `poetry install`\n3. Check for environment issues: `poetry run python -c \"import uiautomator2; print('OK')\"`\n4. If problems persist, the issue may be with your environment or changes you've made\n\nExpected validation results:\n- Unit tests: 25 tests should pass\n- Coverage: Should show ~27% total coverage  \n- Format: Should complete without errors (may show \"Skipped N files\")\n- Build: Should create `dist/` directory with wheel and sdist\n- CLI: Should display help text starting with \"usage: uiautomator2\"","skills/uiautomator2/SKILL.md":"---\nname: uiautomator2\ndescription: >\n  Android device automation via uiautomator2. Use this skill whenever the user wants to\n  click/tap elements, swipe screens, start or stop apps, press hardware keys, type text,\n  take screenshots, inspect UI hierarchy, or perform any actions on an Android device.\n---\n\n# uiautomator2\n\nThis skill helps you automate Android devices using the `u2cli` provided by the `uiautomator2` Python package.\n\n## General Usage\n\n- Use `u2cli <command> [args]` to run commands.\n- Use `u2cli -s <serial> <command> [args]` when multiple Android devices are connected.\n- Examples below show only `<command> [args]`; prepend `u2cli` when running them.\n\n## Commands\n\n### Device Commands\n\n- `dump-hierarchy`: Dump current UI hierarchy for analysis and element selection. Prefer the default output first because u2cli compresses it before returning, which is usually enough and works well with `grep`, for example `dump-hierarchy | grep -i \"keyword\"`. Only use `dump-hierarchy --raw` when you explicitly need the full uncompressed hierarchy.\n- `screenshot`: Capture current screen and save to a local file. The output is the file path and size of the screenshot. Example: `screenshot /tmp/screenshot.jpg`.\n- `app-current`: Get the current foreground app package name and activity.\n- `device-info`: Show device information.\n- `window-size`: Show screen window size.\n- `shell`: Run a shell command on the device. Use `--timeout <seconds>` to set command timeout. Example: `shell \"pm list packages\"`.\n\n### App Commands\n\n- `app-start`: Start an application by package name. Options: `--activity <activity>`, `--wait`, `--stop`. Example: `app-start com.android.settings --activity .Settings --wait`.\n- `app-list`: List installed packages.\n- `app-stop`: Stop an application by package name. Example: `app-stop com.example.app`.\n- `app-install`: Install an APK. Example: `app-install ./app-debug.apk`.\n- `app-uninstall`: Uninstall an application by package name. Example: `app-uninstall com.example.app`.\n- `app-clear`: Clear application data by package name. Example: `app-clear com.example.app`.\n\n### Input Commands\n\n- `press`: Press a hardware or Android key. Example: `press home`.\n- `send-keys`: Type text into the focused input. By default it clears before typing; use `--no-clear` to preserve existing text. Example: `send-keys \"hello world\"`.\n- `clear-text`: Clear focused input text. Example: `clear-text`.\n- `click`: Click coordinates or a selector. Use `X Y` for coordinates, or selector options like `--text`, `--resource-id`, `--description`, and `--class-name`. Example: `click 500 1200`; ratio example: `click 0.5 0.5`; selector example: `click --text Gmail`.\n- `double-click`: Double click coordinates. Options: `--duration <seconds>` for the delay between taps. This command requires `X Y`; selector options are not supported. Example: `double-click 500 1200`; ratio example: `double-click 0.5 0.5`.\n- `long-click`: Long click coordinates or a selector. Options: `--duration <seconds>` and `--timeout <seconds>`. Example: `long-click 500 1200`; ratio example: `long-click 0.5 0.5`; selector example: `long-click --text Gmail`.\n- `swipe`: Swipe from one coordinate to another. Arguments are `FX FY TX TY`. Options: `--duration <seconds>`, `--steps <number>`, `--scale <number>`. Example: `swipe 500 1800 500 400 --duration 0.3`; ratio example: `swipe 0.5 0.8 0.5 0.2 --duration 0.3`.\n- `drag`: Drag from one coordinate to another. Arguments are `SX SY EX EY`. Options: `--duration <seconds>`. Example: `drag 300 1200 800 1200`; ratio example: `drag 0.3 0.5 0.8 0.5`.\n\n### Selector Commands\n\n- `exists`: Check whether a selector exists. Options: `--timeout <seconds>` plus selector options. Example: `exists --text Gmail --timeout 3`.\n- `wait`: Wait for a selector to appear. Use `--gone` to wait until it disappears. Options: `--timeout <seconds>` plus selector options. Example: `wait --text Gmail --timeout 10`; gone example: `wait --text Loading --gone --timeout 10`.\n- `scroll`: Scroll a selector. Options: `--direction vert|horiz`, `--action forward|backward|toEnd|toBeginning`, `--max-swipes <number>`, `--to-text <text>`, plus selector options. Example: `scroll --scrollable --direction vert --action forward`; scroll-to-text example: `scroll --scrollable --to-text Settings`.\n\n### System UI Commands\n\n- `open-notification`: Open the notification shade.\n- `open-quick-settings`: Open quick settings.\n- `open-url`: Open a URL on the device. Example: `open-url https://example.com`.\n\n### Common Selector Options\n\nUse these options with selector-based commands such as `click`, `long-click`, `exists`, `wait`, and `scroll`.\n\n- Text selectors: `--text <text>`, `--text-contains <text>`, `--text-matches <regex>`, `--text-starts-with <text>`.\n- Description selectors: `--description <text>`, `--description-contains <text>`.\n- Resource and class selectors: `--resource-id <id>`, `--class-name <class>`, `--package <package>`.\n- State selectors: `--selected`, `--focused`, `--enabled`, `--scrollable`, `--clickable`, `--checked`, `--checkable`.\n- Position selectors: `--instance <number>`, `--index <number>`.\n- Child selectors: use `--child KEY=VALUE [KEY=VALUE ...]` or child-specific options like `--child-text`, `--child-resource-id`, `--child-class-name`, `--child-clickable`, and `--child-index` to append a child selector level. Example: `click --resource-id com.example:id/list --child text=OK`.\n","Claude.md":"代码要兼容Python3.8\n不允许出现 value: str | None 这种要换成 value: Optional[str]\n"},"items":[{"name":"SKILL.md","path":"skills/uiautomator2/SKILL.md","rawUrl":"https://raw.githubusercontent.com/openatx/uiautomator2/HEAD/skills/uiautomator2/SKILL.md","title":"uiautomator2","category":"anthropic-skill","format":"markdown","content":"---\nname: uiautomator2\ndescription: >\n  Android device automation via uiautomator2. Use this skill whenever the user wants to\n  click/tap elements, swipe screens, start or stop apps, press hardware keys, type text,\n  take screenshots, inspect UI hierarchy, or perform any actions on an Android device.\n---\n\n# uiautomator2\n\nThis skill helps you automate Android devices using the `u2cli` provided by the `uiautomator2` Python package.\n\n## General Usage\n\n- Use `u2cli <command> [args]` to run commands.\n- Use `u2cli -s <serial> <command> [args]` when multiple Android devices are connected.\n- Examples below show only `<command> [args]`; prepend `u2cli` when running them.\n\n## Commands\n\n### Device Commands\n\n- `dump-hierarchy`: Dump current UI hierarchy for analysis and element selection. Prefer the default output first because u2cli compresses it before returning, which is usually enough and works well with `grep`, for example `dump-hierarchy | grep -i \"keyword\"`. Only use `dump-hierarchy --raw` when you explicitly need the full uncompressed hierarchy.\n- `screenshot`: Capture current screen and save to a local file. The output is the file path and size of the screenshot. Example: `screenshot /tmp/screenshot.jpg`.\n- `app-current`: Get the current foreground app package name and activity.\n- `device-info`: Show device information.\n- `window-size`: Show screen window size.\n- `shell`: Run a shell command on the device. Use `--timeout <seconds>` to set command timeout. Example: `shell \"pm list packages\"`.\n\n### App Commands\n\n- `app-start`: Start an application by package name. Options: `--activity <activity>`, `--wait`, `--stop`. Example: `app-start com.android.settings --activity .Settings --wait`.\n- `app-list`: List installed packages.\n- `app-stop`: Stop an application by package name. Example: `app-stop com.example.app`.\n- `app-install`: Install an APK. Example: `app-install ./app-debug.apk`.\n- `app-uninstall`: Uninstall an application by package name. Example: `app-uninstall com.example.app`.\n- `app-clear`: Clear application data by package name. Example: `app-clear com.example.app`.\n\n### Input Commands\n\n- `press`: Press a hardware or Android key. Example: `press home`.\n- `send-keys`: Type text into the focused input. By default it clears before typing; use `--no-clear` to preserve existing text. Example: `send-keys \"hello world\"`.\n- `clear-text`: Clear focused input text. Example: `clear-text`.\n- `click`: Click coordinates or a selector. Use `X Y` for coordinates, or selector options like `--text`, `--resource-id`, `--description`, and `--class-name`. Example: `click 500 1200`; ratio example: `click 0.5 0.5`; selector example: `click --text Gmail`.\n- `double-click`: Double click coordinates. Options: `--duration <seconds>` for the delay between taps. This command requires `X Y`; selector options are not supported. Example: `double-click 500 1200`; ratio example: `double-click 0.5 0.5`.\n- `long-click`: Long click coordinates or a selector. Options: `--duration <seconds>` and `--timeout <seconds>`. Example: `long-click 500 1200`; ratio example: `long-click 0.5 0.5`; selector example: `long-click --text Gmail`.\n- `swipe`: Swipe from one coordinate to another. Arguments are `FX FY TX TY`. Options: `--duration <seconds>`, `--steps <number>`, `--scale <number>`. Example: `swipe 500 1800 500 400 --duration 0.3`; ratio example: `swipe 0.5 0.8 0.5 0.2 --duration 0.3`.\n- `drag`: Drag from one coordinate to another. Arguments are `SX SY EX EY`. Options: `--duration <seconds>`. Example: `drag 300 1200 800 1200`; ratio example: `drag 0.3 0.5 0.8 0.5`.\n\n### Selector Commands\n\n- `exists`: Check whether a selector exists. Options: `--timeout <seconds>` plus selector options. Example: `exists --text Gmail --timeout 3`.\n- `wait`: Wait for a selector to appear. Use `--gone` to wait until it disappears. Options: `--timeout <seconds>` plus selector options. Example: `wait --text Gmail --timeout 10`; gone example: `wait --text Loading --gone --timeout 10`.\n- `scroll`: Scroll a selector. Options: `--direction vert|horiz`, `--action forward|backward|toEnd|toBeginning`, `--max-swipes <number>`, `--to-text <text>`, plus selector options. Example: `scroll --scrollable --direction vert --action forward`; scroll-to-text example: `scroll --scrollable --to-text Settings`.\n\n### System UI Commands\n\n- `open-notification`: Open the notification shade.\n- `open-quick-settings`: Open quick settings.\n- `open-url`: Open a URL on the device. Example: `open-url https://example.com`.\n\n### Common Selector Options\n\nUse these options with selector-based commands such as `click`, `long-click`, `exists`, `wait`, and `scroll`.\n\n- Text selectors: `--text <text>`, `--text-contains <text>`, `--text-matches <regex>`, `--text-starts-with <text>`.\n- Description selectors: `--description <text>`, `--description-contains <text>`.\n- Resource and class selectors: `--resource-id <id>`, `--class-name <class>`, `--package <package>`.\n- State selectors: `--selected`, `--focused`, `--enabled`, `--scrollable`, `--clickable`, `--checked`, `--checkable`.\n- Position selectors: `--instance <number>`, `--index <number>`.\n- Child selectors: use `--child KEY=VALUE [KEY=VALUE ...]` or child-specific options like `--child-text`, `--child-resource-id`, `--child-class-name`, `--child-clickable`, and `--child-index` to append a child selector level. Example: `click --resource-id com.example:id/list --child text=OK`.\n","frontmatter":{"name":"uiautomator2","description":"Android device automation via uiautomator2. Use this skill whenever the user wants to click/tap elements, swipe screens, start or stop apps, press hardware keys, type text, take screenshots, inspect UI hierarchy, or perform any actions on an Android device.\n"},"isInternal":false,"tokens":1415,"sizeBytes":5430},{"name":"Claude.md","path":"Claude.md","rawUrl":"https://raw.githubusercontent.com/openatx/uiautomator2/HEAD/Claude.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"代码要兼容Python3.8\n不允许出现 value: str | None 这种要换成 value: Optional[str]\n","isInternal":false,"tokens":33,"sizeBytes":96},{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","rawUrl":"https://raw.githubusercontent.com/openatx/uiautomator2/HEAD/.github/copilot-instructions.md","title":"GitHub Copilot Instructions","category":"copilot-instructions","format":"markdown","content":"# uiautomator2\n\nuiautomator2 is a Python library providing a simple, easy-to-use, and stable Android automation framework. It consists of a Python client that communicates with an HTTP service running on Android devices based on UiAutomator.\n\n**ALWAYS follow these instructions first and completely. Only fallback to additional search and context gathering if the information in these instructions is incomplete or found to be in error.**\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Initial Setup\n- `pip install poetry` -- Install Poetry dependency manager\n- `poetry install` -- Install all dependencies in virtual environment. NEVER CANCEL: Takes 3-5 minutes. Set timeout to 8+ minutes.\n- Poetry will create a virtual environment in `.venv/` directory\n\n### Build and Test Process\n- `poetry run pytest tests/ -v` -- Run unit tests (25 tests). Takes ~3 seconds. All tests should pass.\n- `make cov` -- Run coverage tests. Takes ~3 seconds. Should show ~27% coverage.\n- `make format` -- Format code with isort. Takes ~1 second. ALWAYS run before committing.\n- `poetry build` -- Build distribution packages. Takes ~5 seconds. Creates wheel and sdist in `dist/`.\n- `poetry run uiautomator2 version` -- Check CLI functionality. Should output version number.\n\n### Asset Synchronization (Optional)\n- `make sync` -- Download required APK and JAR assets. FAILS due to network restrictions in sandboxed environment. This is EXPECTED and not required for development.\n- Asset sync downloads Android APK and u2.jar from external hosts which are blocked in this environment.\n\n### Commands That Will Fail (Expected)\n- `make test` -- Mobile tests require Android device via ADB. Will fail with \"Can't find any android device/emulator\" - this is EXPECTED.\n- `make build` -- Full build with poetry plugin. May fail due to system package conflicts. Use `poetry build` instead.\n- `make sync` -- Asset download fails due to network restrictions. Not required for core development.\n\n## Validation Scenarios\n\nAfter making changes, ALWAYS run this validation sequence:\n\n1. **Unit Tests**: `poetry run pytest tests/ -v` -- Must pass all 25 tests\n2. **Coverage**: `make cov` -- Should complete without errors\n3. **Formatting**: `make format` -- Always format before committing  \n4. **Build**: `poetry build` -- Must complete successfully\n5. **CLI Test**: `poetry run uiautomator2 --help` -- Should show help output\n\n### Manual Testing Scenarios\n- Test version command: `poetry run uiautomator2 version`\n- Test CLI help: `poetry run uiautomator2 --help`\n- Verify core imports: `poetry run python -c \"import uiautomator2; print('Import successful')\"`\n\n## Key Components and Structure\n\n### Core Modules (uiautomator2/)\n- `__init__.py` -- Main API and connection functions (426 lines, 27% coverage)\n- `xpath.py` -- XPath selector implementation (411 lines, 62% coverage)  \n- `_selector.py` -- UI element selectors (320 lines, 19% coverage)\n- `core.py` -- Core device interaction (214 lines, 21% coverage)\n- `watcher.py` -- Event watchers (212 lines, 20% coverage)\n\n### Test Directories\n- `tests/` -- Unit tests (25 tests, no device required)\n- `mobile_tests/` -- Integration tests (30 tests, require Android device)\n- `demo_tests/` -- Example/demo tests\n\n### Build Configuration\n- `pyproject.toml` -- Poetry configuration and dependencies\n- `Makefile` -- Build automation (format, test, build, sync commands)\n- `.coveragerc` -- Coverage configuration\n\n### Additional Components\n- `uibox/` -- Go component for Android binary tools (separate build system)\n\n### Documentation\n- `README.md` -- Main documentation with usage examples\n- `DEVELOP.md` -- Development setup instructions\n- `XPATH.md` -- XPath selector documentation\n- `CHANGELOG` -- Version history\n\n## Common Development Tasks\n\n### Adding New Features\n1. Run existing tests to ensure baseline: `poetry run pytest tests/ -v`\n2. Implement changes in appropriate module under `uiautomator2/`\n3. Add unit tests in `tests/` directory\n4. Run tests: `poetry run pytest tests/ -v`\n5. Format code: `make format`\n6. Check coverage: `make cov`\n7. Build to verify: `poetry build`\n\n### Debugging Issues\n- Enable debug logging: Use `-d` flag with CLI commands\n- Check import issues: `poetry run python -c \"import uiautomator2\"`\n- Device connection issues require actual Android device (expected to fail in this environment)\n\n### Code Style\n- Uses isort for import sorting with HANGING_INDENT mode and 120 character line length\n- Coverage requirement: Tests should maintain or improve the ~27% coverage baseline\n- All code must pass existing unit tests\n\n## Environment Limitations\n\n**CANNOT DO (Expected Failures):**\n- Mobile testing without Android device\n- Asset synchronization (network blocked)\n- Full make build (dependency conflicts)\n\n**CAN DO:**\n- Unit testing (tests/ directory)\n- Code formatting and linting\n- Building with `poetry build`\n- CLI testing and development\n- Core library development\n\n## Time Expectations\n\n- **NEVER CANCEL**: Poetry install takes 3-5 minutes. Set timeout to 8+ minutes.\n- Unit tests: ~2.5 seconds\n- Coverage tests: ~3.5 seconds  \n- Code formatting: ~0.5 seconds\n- Poetry build: ~3 seconds\n- Full validation sequence: ~12 seconds\n\n## Key Commands Reference\n\n```bash\n# Essential development workflow\npoetry install                    # Setup (3-5 min, NEVER CANCEL)\npoetry run pytest tests/ -v       # Unit tests (2.5s)\nmake format                       # Format (0.5s) \nmake cov                          # Coverage (3.5s)\npoetry build                      # Build (3s)\n\n# CLI testing\npoetry run uiautomator2 version   # Version check\npoetry run uiautomator2 --help    # Help system\n\n# Known failures (expected in sandboxed environment)\nmake test                         # Requires Android device\nmake sync                         # Network blocked\nmake build                        # Dependency conflicts\n```\n\nAlways validate changes with the full sequence: tests → format → coverage → build → CLI test.\n\n## Validation Guarantee\n\n**Every command in these instructions has been validated to work correctly.** If any command fails unexpectedly:\n\n1. First check that you're in the correct directory: `/path/to/uiautomator2`\n2. Ensure Poetry virtual environment is properly set up: `poetry install`\n3. Check for environment issues: `poetry run python -c \"import uiautomator2; print('OK')\"`\n4. If problems persist, the issue may be with your environment or changes you've made\n\nExpected validation results:\n- Unit tests: 25 tests should pass\n- Coverage: Should show ~27% total coverage  \n- Format: Should complete without errors (may show \"Skipped N files\")\n- Build: Should create `dist/` directory with wheel and sdist\n- CLI: Should display help text starting with \"usage: uiautomator2\"","isInternal":false,"tokens":1614,"sizeBytes":6891}],"systemPromptSnippet":"<yakaai_skills repo=\"openatx/uiautomator2\">\n<!-- File: skills/uiautomator2/SKILL.md (Tokens: ~1415 | Category: anthropic-skill) -->\n---\nname: uiautomator2\ndescription: >\n  Android device automation via uiautomator2. Use this skill whenever the user wants to\n  click/tap elements, swipe screens, start or stop apps, press hardware keys, type text,\n  take screenshots, inspect UI hierarchy, or perform any actions on an Android device.\n---\n\n# uiautomator2\n\nThis skill helps you automate Android devices using the `u2cli` provided by the `uiautomator2` Python package.\n\n## General Usage\n\n- Use `u2cli <command> [args]` to run commands.\n- Use `u2cli -s <serial> <command> [args]` when multiple Android devices are connected.\n- Examples below show only `<command> [args]`; prepend `u2cli` when running them.\n\n## Commands\n\n### Device Commands\n\n- `dump-hierarchy`: Dump current UI hierarchy for analysis and element selection. Prefer the default output first because u2cli compresses it before returning, which is usually enough and works well with `grep`, for example `dump-hierarchy | grep -i \"keyword\"`. Only use `dump-hierarchy --raw` when you explicitly need the full uncompressed hierarchy.\n- `screenshot`: Capture current screen and save to a local file. The output is the file path and size of the screenshot. Example: `screenshot /tmp/screenshot.jpg`.\n- `app-current`: Get the current foreground app package name and activity.\n- `device-info`: Show device information.\n- `window-size`: Show screen window size.\n- `shell`: Run a shell command on the device. Use `--timeout <seconds>` to set command timeout. Example: `shell \"pm list packages\"`.\n\n### App Commands\n\n- `app-start`: Start an application by package name. Options: `--activity <activity>`, `--wait`, `--stop`. Example: `app-start com.android.settings --activity .Settings --wait`.\n- `app-list`: List installed packages.\n- `app-stop`: Stop an application by package name. Example: `app-stop com.example.app`.\n- `app-install`: Install an APK. Example: `app-install ./app-debug.apk`.\n- `app-uninstall`: Uninstall an application by package name. Example: `app-uninstall com.example.app`.\n- `app-clear`: Clear application data by package name. Example: `app-clear com.example.app`.\n\n### Input Commands\n\n- `press`: Press a hardware or Android key. Example: `press home`.\n- `send-keys`: Type text into the focused input. By default it clears before typing; use `--no-clear` to preserve existing text. Example: `send-keys \"hello world\"`.\n- `clear-text`: Clear focused input text. Example: `clear-text`.\n- `click`: Click coordinates or a selector. Use `X Y` for coordinates, or selector options like `--text`, `--resource-id`, `--description`, and `--class-name`. Example: `click 500 1200`; ratio example: `click 0.5 0.5`; selector example: `click --text Gmail`.\n- `double-click`: Double click coordinates. Options: `--duration <seconds>` for the delay between taps. This command requires `X Y`; selector options are not supported. Example: `double-click 500 1200`; ratio example: `double-click 0.5 0.5`.\n- `long-click`: Long click coordinates or a selector. Options: `--duration <seconds>` and `--timeout <seconds>`. Example: `long-click 500 1200`; ratio example: `long-click 0.5 0.5`; selector example: `long-click --text Gmail`.\n- `swipe`: Swipe from one coordinate to another. Arguments are `FX FY TX TY`. Options: `--duration <seconds>`, `--steps <number>`, `--scale <number>`. Example: `swipe 500 1800 500 400 --duration 0.3`; ratio example: `swipe 0.5 0.8 0.5 0.2 --duration 0.3`.\n- `drag`: Drag from one coordinate to another. Arguments are `SX SY EX EY`. Options: `--duration <seconds>`. Example: `drag 300 1200 800 1200`; ratio example: `drag 0.3 0.5 0.8 0.5`.\n\n### Selector Commands\n\n- `exists`: Check whether a selector exists. Options: `--timeout <seconds>` plus selector options. Example: `exists --text Gmail --timeout 3`.\n- `wait`: Wait for a selector to appear. Use `--gone` to wait until it disappears. Options: `--timeout <seconds>` plus selector options. Example: `wait --text Gmail --timeout 10`; gone example: `wait --text Loading --gone --timeout 10`.\n- `scroll`: Scroll a selector. Options: `--direction vert|horiz`, `--action forward|backward|toEnd|toBeginning`, `--max-swipes <number>`, `--to-text <text>`, plus selector options. Example: `scroll --scrollable --direction vert --action forward`; scroll-to-text example: `scroll --scrollable --to-text Settings`.\n\n### System UI Commands\n\n- `open-notification`: Open the notification shade.\n- `open-quick-settings`: Open quick settings.\n- `open-url`: Open a URL on the device. Example: `open-url https://example.com`.\n\n### Common Selector Options\n\nUse these options with selector-based commands such as `click`, `long-click`, `exists`, `wait`, and `scroll`.\n\n- Text selectors: `--text <text>`, `--text-contains <text>`, `--text-matches <regex>`, `--text-starts-with <text>`.\n- Description selectors: `--description <text>`, `--description-contains <text>`.\n- Resource and class selectors: `--resource-id <id>`, `--class-name <class>`, `--package <package>`.\n- State selectors: `--selected`, `--focused`, `--enabled`, `--scrollable`, `--clickable`, `--checked`, `--checkable`.\n- Position selectors: `--instance <number>`, `--index <number>`.\n- Child selectors: use `--child KEY=VALUE [KEY=VALUE ...]` or child-specific options like `--child-text`, `--child-resource-id`, `--child-class-name`, `--child-clickable`, and `--child-index` to append a child selector level. Example: `click --resource-id com.example:id/list --child text=OK`.\n\n<!-- File: Claude.md (Tokens: ~33 | Category: claude-rule) -->\n代码要兼容Python3.8\n不允许出现 value: str | None 这种要换成 value: Optional[str]\n\n<!-- File: .github/copilot-instructions.md (Tokens: ~1614 | Category: copilot-instructions) -->\n# uiautomator2\n\nuiautomator2 is a Python library providing a simple, easy-to-use, and stable Android automation framework. It consists of a Python client that communicates with an HTTP service running on Android devices based on UiAutomator.\n\n**ALWAYS follow these instructions first and completely. Only fallback to additional search and context gathering if the information in these instructions is incomplete or found to be in error.**\n\nAlways reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.\n\n## Working Effectively\n\n### Initial Setup\n- `pip install poetry` -- Install Poetry dependency manager\n- `poetry install` -- Install all dependencies in virtual environment. NEVER CANCEL: Takes 3-5 minutes. Set timeout to 8+ minutes.\n- Poetry will create a virtual environment in `.venv/` directory\n\n### Build and Test Process\n- `poetry run pytest tests/ -v` -- Run unit tests (25 tests). Takes ~3 seconds. All tests should pass.\n- `make cov` -- Run coverage tests. Takes ~3 seconds. Should show ~27% coverage.\n- `make format` -- Format code with isort. Takes ~1 second. ALWAYS run before committing.\n- `poetry build` -- Build distribution packages. Takes ~5 seconds. Creates wheel and sdist in `dist/`.\n- `poetry run uiautomator2 version` -- Check CLI functionality. Should output version number.\n\n### Asset Synchronization (Optional)\n- `make sync` -- Download required APK and JAR assets. FAILS due to network restrictions in sandboxed environment. This is EXPECTED and not required for development.\n- Asset sync downloads Android APK and u2.jar from external hosts which are blocked in this environment.\n\n### Commands That Will Fail (Expected)\n- `make test` -- Mobile tests require Android device via ADB. Will fail with \"Can't find any android device/emulator\" - this is EXPECTED.\n- `make build` -- Full build with poetry plugin. May fail due to system package conflicts. Use `poetry build` instead.\n- `make sync` -- Asset download fails due to network restrictions. Not required for core development.\n\n## Validation Scenarios\n\nAfter making changes, ALWAYS run this validation sequence:\n\n1. **Unit Tests**: `poetry run pytest tests/ -v` -- Must pass all 25 tests\n2. **Coverage**: `make cov` -- Should complete without errors\n3. **Formatting**: `make format` -- Always format before committing  \n4. **Build**: `poetry build` -- Must complete successfully\n5. **CLI Test**: `poetry run uiautomator2 --help` -- Should show help output\n\n### Manual Testing Scenarios\n- Test version command: `poetry run uiautomator2 version`\n- Test CLI help: `poetry run uiautomator2 --help`\n- Verify core imports: `poetry run python -c \"import uiautomator2; print('Import successful')\"`\n\n## Key Components and Structure\n\n### Core Modules (uiautomator2/)\n- `__init__.py` -- Main API and connection functions (426 lines, 27% coverage)\n- `xpath.py` -- XPath selector implementation (411 lines, 62% coverage)  \n- `_selector.py` -- UI element selectors (320 lines, 19% coverage)\n- `core.py` -- Core device interaction (214 lines, 21% coverage)\n- `watcher.py` -- Event watchers (212 lines, 20% coverage)\n\n### Test Directories\n- `tests/` -- Unit tests (25 tests, no device required)\n- `mobile_tests/` -- Integration tests (30 tests, require Android device)\n- `demo_tests/` -- Example/demo tests\n\n### Build Configuration\n- `pyproject.toml` -- Poetry configuration and dependencies\n- `Makefile` -- Build automation (format, test, build, sync commands)\n- `.coveragerc` -- Coverage configuration\n\n### Additional Components\n- `uibox/` -- Go component for Android binary tools (separate build system)\n\n### Documentation\n- `README.md` -- Main documentation with usage examples\n- `DEVELOP.md` -- Development setup instructions\n- `XPATH.md` -- XPath selector documentation\n- `CHANGELOG` -- Version history\n\n## Common Development Tasks\n\n### Adding New Features\n1. Run existing tests to ensure baseline: `poetry run pytest tests/ -v`\n2. Implement changes in appropriate module under `uiautomator2/`\n3. Add unit tests in `tests/` directory\n4. Run tests: `poetry run pytest tests/ -v`\n5. Format code: `make format`\n6. Check coverage: `make cov`\n7. Build to verify: `poetry build`\n\n### Debugging Issues\n- Enable debug logging: Use `-d` flag with CLI commands\n- Check import issues: `poetry run python -c \"import uiautomator2\"`\n- Device connection issues require actual Android device (expected to fail in this environment)\n\n### Code Style\n- Uses isort for import sorting with HANGING_INDENT mode and 120 character line length\n- Coverage requirement: Tests should maintain or improve the ~27% coverage baseline\n- All code must pass existing unit tests\n\n## Environment Limitations\n\n**CANNOT DO (Expected Failures):**\n- Mobile testing without Android device\n- Asset synchronization (network blocked)\n- Full make build (dependency conflicts)\n\n**CAN DO:**\n- Unit testing (tests/ directory)\n- Code formatting and linting\n- Building with `poetry build`\n- CLI testing and development\n- Core library development\n\n## Time Expectations\n\n- **NEVER CANCEL**: Poetry install takes 3-5 minutes. Set timeout to 8+ minutes.\n- Unit tests: ~2.5 seconds\n- Coverage tests: ~3.5 seconds  \n- Code formatting: ~0.5 seconds\n- Poetry build: ~3 seconds\n- Full validation sequence: ~12 seconds\n\n## Key Commands Reference\n\n```bash\n# Essential development workflow\npoetry install                    # Setup (3-5 min, NEVER CANCEL)\npoetry run pytest tests/ -v       # Unit tests (2.5s)\nmake format                       # Format (0.5s) \nmake cov                          # Coverage (3.5s)\npoetry build                      # Build (3s)\n\n# CLI testing\npoetry run uiautomator2 version   # Version check\npoetry run uiautomator2 --help    # Help system\n\n# Known failures (expected in sandboxed environment)\nmake test                         # Requires Android device\nmake sync                         # Network blocked\nmake build                        # Dependency conflicts\n```\n\nAlways validate changes with the full sequence: tests → format → coverage → build → CLI test.\n\n## Validation Guarantee\n\n**Every command in these instructions has been validated to work correctly.** If any command fails unexpectedly:\n\n1. First check that you're in the correct directory: `/path/to/uiautomator2`\n2. Ensure Poetry virtual environment is properly set up: `poetry install`\n3. Check for environment issues: `poetry run python -c \"import uiautomator2; print('OK')\"`\n4. If problems persist, the issue may be with your environment or changes you've made\n\nExpected validation results:\n- Unit tests: 25 tests should pass\n- Coverage: Should show ~27% total coverage  \n- Format: Should complete without errors (may show \"Skipped N files\")\n- Build: Should create `dist/` directory with wheel and sdist\n- CLI: Should display help text starting with \"usage: uiautomator2\"\n</yakaai_skills>"}