# Setup Uiautomator2

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-appium-skills-setup-uiautomator2`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [appium](https://agentstack.voostack.com/s/appium)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [appium](https://github.com/appium)
- **Source:** https://github.com/appium/skills/tree/main/skills/setup-uiautomator2

## Install

```sh
agentstack add skill-appium-skills-setup-uiautomator2
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# UiAutomator2 Setup Workflow

## UiAutomator2 setup routing and handoffs

Prepare only the UiAutomator2 route. Hand an already failing UiAutomator2
session or command back to `skills/appium-troubleshooting/SKILL.md` after
required setup checks pass. 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 outline

1. Load the global command profile by default or the local profile only when
   explicitly requested.
2. Load the Android profile, shared Appium setup basics, and Android emulator
   setup Context.
3. Load the UiAutomator2 decision, installation, doctor, and smoke references
   in that order.
4. Run `node tools/appium/setup/scripts/check-uiautomator2-env.mjs`; pass
   `--appium-mode local` only for local mode. Apply required fixes in technical
   dependency order and rerun the affected check after each fix.
5. Run the UiAutomator2 doctor and server smoke checks. Load the matching
   example only when it clarifies execution.

## 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 cleanup leaves no
  Appium server process.

## 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.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [appium](https://github.com/appium)
- **Source:** [appium/skills](https://github.com/appium/skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-appium-skills-setup-uiautomator2
- Seller: https://agentstack.voostack.com/s/appium
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
