Android Simulator Autotest
Use this skill when the user asks to validate a feature/screen change on Android with autonomous checks in emulator.
Preconditions
- Android emulator is running and visible in
adb devices. ANDROID_SDK_ROOTis configured (orADB_BINis passed explicitly).- Target repo has
./gradlew. - For docs-driven flow traversal, include
docs/navigation.mdanddocs/flows.md(or pass overrides).
Primary command
/absolute/path/to/skills/android-simulator-autotest/scripts/run.sh /absolute/path/to/repo
This skill is portable: it does not require adding scripts to each project and auto-detects module/app/activity/tasks in the target repo. The project path argument is mandatory to avoid running against the wrong workspace.
What it validates
- Connected Android test task (auto-detected per module, e.g.
:app:connectedDebugAndroidTest) - Unit test task (auto-detected per module, e.g.
:app:testDebugUnitTestor:app:test) - App launch smoke (
am start -W) - UI journey smoke in emulator (real control with
adb+ UI hierarchy), with routes inferred from project docs:- parses
docs/flows.md+docs/navigation.md - derives reachable
Main.*routes and route transitions - attempts auth entry (
Sign In,Login) when visible - navigates route labels inferred from docs (not hardcoded to one app)
- performs scroll interactions and opens detail cards when flow indicates detail transitions
- attempts profile shortcut if docs mention profile/my-account flow
- parses
logcatcritical patterns (FATAL EXCEPTION,AndroidRuntime,ANR)- Docs-vs-code audit using:
docs/navigation.mddocs/flows.mdcomposeApp/src/commonMain/kotlin/com/dinamicarea/membersclub/ui/Navigation.ktcomposeApp/src/commonMain/kotlin/com/dinamicarea/membersclub/ui/AppDestination.kt
Reports
All outputs are stored in the detected Android module under:
<android-module>/build/reports/autotest/
connectedDebugAndroidTest.logtest.logapp_launch.logui_journey.logui_journey_report.mdlogcat_critical.lognavigation_flow_audit.md
Useful env vars
CONNECTED_TEST_TASK,UNIT_TEST_TASKto force Gradle tasks.APP_ID,MAIN_ACTIVITYto override autodetected launch target.FAIL_ON_DOC_DRIFT=1to fail when docs and routes drift.RUN_UI_JOURNEY=0to skip UI journey control.ADB_BINif SDK path is custom.NAV_DOC,FLOWS_DOC,NAV_CODE,DESTINATION_CODEto override file paths.
Agent behavior
- Run autotest after implementing feature changes.
- If failing:
- fix regressions first,
- rerun until green,
- summarize exactly what failed and what changed.
- If docs audit reports drift:
- state whether code or docs is source of truth,
- propose/update docs or routes accordingly.