UiAutomator2 Setup Workflow
Routing
Use this Skill to prepare or repair UiAutomator2 prerequisites selected by
skills/setup/SKILL.md or handed off by
skills/appium-troubleshooting/SKILL.md. After required setup checks pass,
route an existing UiAutomator2 session or command failure back to
skills/appium-troubleshooting/SKILL.md. Load FFmpeg or bundletool only when
the user explicitly requested that capability.
Required inputs
Confirm Android as the target, global appium mode or explicitly requested
local npx appium mode, host OS, device or emulator expectations, permissions,
and optional dependency requests.
Workflow
- Load the global command profile by default or the local profile only when
explicitly requested.
- Load the Android profile, shared Appium setup basics, and Android emulator
setup Context.
- Load the UiAutomator2 decision, installation, doctor, and smoke references
in that order.
- Run
node tools/appium/setup/scripts/check-uiautomator2-env.mjs --format summary --report auto; add
--appium-mode local only for explicitly requested local mode. Verify
summary.requiredOk: true, summary.driverInstalled: true, a populated
summary.driverVersion, and summary.doctorRequiredOk: true.
Apply required fixes in technical dependency order and rerun affected checks.
If the gate remains unresolved, report blocked with evidence and the next
action. Load the matching example only when needed.
- Verify the direct doctor output reports
0 required fixes needed using
appium driver doctor uiautomator2, or
npx --no-install appium driver doctor uiautomator2 in local mode.
- Run
node tools/appium/setup/scripts/smoke-appium-server.mjs --driver uiautomator2 --report auto;
add --appium-mode local only in local mode. Require
summary.requiredOk: true for server readiness, driver evidence, and
cleanup. The smoke reference documents target-specific options.
UiAutomator2 setup safety and approval constraints
- Preserve the selected command mode throughout the workflow.
- Ask before optional FFmpeg or bundletool setup, privileged commands, SDK
license changes, or emulator creation that changes local state.
- Preserve working Java, Android SDK, device, emulator, and driver
installations.
Completion criteria
- Android environment completion criteria pass.
- Appium succeeds in the selected command mode.
- The installed driver list includes
uiautomator2.
appium driver doctor uiautomator2 reports 0 required fixes needed;
optional warnings are non-blocking.
/status succeeds, server logs list uiautomator2, and the server
started for verification has exited.
Evidence boundary
Report Appium and UiAutomator2 versions, helper requiredOk, Android
prerequisite summary, doctor required/optional summary, /status, server
driver evidence, cleanup, and explicitly requested optional capability results.
Self-Improvement Prompt
Before the final response, report any missing, ambiguous, outdated, or
retry-causing UiAutomator2 setup instruction with its asset path and proposed
wording. Leave unrelated assets unchanged.
1---2name: setup-uiautomator23description: Prepare and verify Appium UiAutomator2 by validating Node/Appium, Android SDK and Java prerequisites, driver installation, doctor output, and server smoke evidence. Use after the setup Skill selects UiAutomator2 or appium-troubleshooting hands off a UiAutomator2 prerequisite or doctor failure. Do not use for an existing runtime failure after prerequisites pass.4---56# UiAutomator2 Setup Workflow78## Routing910Use this Skill to prepare or repair UiAutomator2 prerequisites selected by11`skills/setup/SKILL.md` or handed off by12`skills/appium-troubleshooting/SKILL.md`. After required setup checks pass,13route an existing UiAutomator2 session or command failure back to14`skills/appium-troubleshooting/SKILL.md`. Load FFmpeg or bundletool only when15the user explicitly requested that capability.1617## Required inputs1819Confirm Android as the target, global `appium` mode or explicitly requested20local `npx appium` mode, host OS, device or emulator expectations, permissions,21and optional dependency requests.2223## Workflow24251. Load the global command profile by default or the local profile only when26 explicitly requested.272. Load the Android profile, shared Appium setup basics, and Android emulator28 setup Context.293. Load the UiAutomator2 decision, installation, doctor, and smoke references30 in that order.314. Run `node tools/appium/setup/scripts/check-uiautomator2-env.mjs --format summary --report auto`; add32 `--appium-mode local` only for explicitly requested local mode. Verify33 `summary.requiredOk: true`, `summary.driverInstalled: true`, a populated34 `summary.driverVersion`, and `summary.doctorRequiredOk: true`.35 Apply required fixes in technical dependency order and rerun affected checks.36 If the gate remains unresolved, report `blocked` with evidence and the next37 action. Load the matching example only when needed.385. Verify the direct doctor output reports `0 required fixes needed` using39 `appium driver doctor uiautomator2`, or40 `npx --no-install appium driver doctor uiautomator2` in local mode.416. Run `node tools/appium/setup/scripts/smoke-appium-server.mjs --driver uiautomator2 --report auto`;42 add `--appium-mode local` only in local mode. Require43 `summary.requiredOk: true` for server readiness, driver evidence, and44 cleanup. The smoke reference documents target-specific options.4546## UiAutomator2 setup safety and approval constraints4748- Preserve the selected command mode throughout the workflow.49- Ask before optional FFmpeg or bundletool setup, privileged commands, SDK50 license changes, or emulator creation that changes local state.51- Preserve working Java, Android SDK, device, emulator, and driver52 installations.5354## Completion criteria5556- Android environment completion criteria pass.57- Appium succeeds in the selected command mode.58- The installed driver list includes `uiautomator2`.59- `appium driver doctor uiautomator2` reports `0 required fixes needed`;60 optional warnings are non-blocking.61- `/status` succeeds, server logs list `uiautomator2`, and the server62 started for verification has exited.6364## Evidence boundary6566Report Appium and UiAutomator2 versions, helper `requiredOk`, Android67prerequisite summary, doctor required/optional summary, `/status`, server68driver evidence, cleanup, and explicitly requested optional capability results.6970## Self-Improvement Prompt7172Before the final response, report any missing, ambiguous, outdated, or73retry-causing UiAutomator2 setup instruction with its asset path and proposed74wording. Leave unrelated assets unchanged.