name: android-ui-automator-preview description: 'Capture quick Android UI evidence with explicit launches, UIAutomator dumps, and adb screenshots for fast visual debugging and reproducible repro notes.' argument-hint: 'Provide the full application ID, target screen, and whether app data should be cleared first'
Android UI Automator Preview
What This Skill Produces
- A deterministic launch path into the real app activity.
- Repeatable post-clear-data navigation steps for AniTrend onboarding flows.
- Paired UI evidence: XML hierarchy plus PNG screenshot.
- Fast text extraction from dumps to confirm whether expected labels are present.
When To Use
- You need quick visual proof of what is currently on-screen.
- A repro depends on onboarding or permission prompts after
pm clear. - You suspect drawer/menu truncation and need objective evidence before code changes.
Preconditions
- If the full application ID is not provided, stop and ask for it before running any adb command.
- If the target device is not the expected resolution or density, re-derive coordinates from a fresh
uiautomator dumpor scale them from the recorded 1080x2400 @ 420dpi baseline. - If the user says app data should not be cleared, skip the clear-data command and continue from the explicit launch step.
Procedure
- Start from a known state.
adb devices -l
adb logcat -c
# Only run when the user explicitly asks to clear app data:
# adb shell pm clear <package-name>
- Launch the intended activity explicitly.
adb shell am start -n <package-name>/co.anitrend.android.deeplink.component.screen.DeepLinkScreen
Why:
- Replace
<package-name>with the application ID for the installed build. - The activity class is fixed for AniTrend; replace it only if you are targeting a different app.
- Explicit launch avoids
monkeyrandomness.
- Drive onboarding and permission prompts (AniTrend profile).
These coordinates are a recorded baseline for 1080x2400 @ 420dpi only.
Re-derive coordinates from a fresh uiautomator dump before using them on a
different device or resolution.
# Recorded baseline only - re-derive for your device:
# adb shell input swipe 900 1700 200 1700 300 # onboarding page 1 -> 2
# adb shell input swipe 900 1700 200 1700 300 # onboarding page 2 -> 3
# adb shell input swipe 900 1700 200 1700 300 # onboarding page 3 -> 4
# adb shell input swipe 900 1700 200 1700 300 # onboarding page 4 -> 5
# adb shell input tap 540 2280 # tap Get Started
# adb shell input tap 540 1285 # tap Allow
- Open target UI (example: drawer nav button region).
# Recorded baseline only - re-derive for your device:
# adb shell input tap 84 2240
- Capture XML and screenshot.
adb shell uiautomator dump /sdcard/window_dump.xml
adb pull /sdcard/window_dump.xml /tmp/window_dump.xml
adb exec-out screencap -p > /tmp/screen.png
- Validate expected labels.
grep -E "General|Manage|Catalogs|Support|Home|Discover|News|Forums|Episodes|FAQ" /tmp/window_dump.xml
- Optional: capture process-scoped logs during same window.
pid=$(adb shell pidof -s <package-name> | tr -d '\r')
adb logcat -d --pid="$pid" > /tmp/<package-name>-ui-window.log
Completion Checklist
- Explicit activity launch command recorded.
- XML dump and PNG screenshot captured from same UI state.
- Any onboarding/permission steps documented with tap/swipe actions.
- At least one text-based assertion from the XML hierarchy included.
Fast Invocation Examples
- "Capture current drawer screen as XML + PNG after clear-data flow"
- "Run explicit launch and show whether onboarding is blocking main shell"
- "Grab small screenshot proof for this emulator repro"