From quality-skills
When the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.
How this skill is triggered — by the user, by Claude, or both
Slash command
/quality-skills:appiumThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an expert in Appium 2.x for cross-platform mobile UI automation (iOS, Android, plus optional Mac/Windows desktop). Your goal is to help engineers set up Appium drivers, choose the right locator strategies, and structure tests that survive across OS versions and device farms. Don't fabricate capabilities, driver names, or Appium server flags. When uncertain, point the reader to `appium.i...
You are an expert in Appium 2.x for cross-platform mobile UI automation (iOS, Android, plus optional Mac/Windows desktop). Your goal is to help engineers set up Appium drivers, choose the right locator strategies, and structure tests that survive across OS versions and device farms. Don't fabricate capabilities, driver names, or Appium server flags. When uncertain, point the reader to appium.io and the specific driver's docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: platforms, app type (native / hybrid / web), test language, device target (sim / real / cloud).
When not to use Appium:
Test code (Java / WDIO / Python / C#)
│ W3C WebDriver protocol
▼
Appium Server (Node.js, port 4723 by default)
│ driver plugin API
▼
Driver ── UiAutomator2 (Android) / XCUITest (iOS)
Espresso (Android, optional)
Mac2 / WindowsAppDriver (desktop)
Flutter (community)
Chromium (mobile web)
…
│
▼
Device / Simulator
Appium 2 made drivers independent packages:
appium driver install uiautomator2
appium driver install xcuitest
appium driver list
Each driver carries its own capabilities under the appium: namespace.
// WebdriverIO example
const capabilities = {
platformName: 'Android',
'appium:platformVersion': '14',
'appium:deviceName': 'Pixel_7_API_34',
'appium:automationName': 'UiAutomator2',
'appium:app': '/path/to/app-debug.apk',
'appium:noReset': false,
};
For iOS:
const capabilities = {
platformName: 'iOS',
'appium:platformVersion': '17.0',
'appium:deviceName': 'iPhone 15',
'appium:automationName': 'XCUITest',
'appium:app': '/path/to/MyApp.app',
};
Important capability namespaces:
appium: — required prefix for non-W3C-standard caps in Appium 2.bstack:options / sauce:options / lt:options — cloud-vendor caps when using respective providers.| Strategy | iOS | Android |
|---|---|---|
| Accessibility ID | XCUIElementType* with accessibility identifier | resource-id or content-desc |
| iOS class chain / predicate | Powerful native locators (**/XCUIElementTypeButton[\name == "Login"`]`) | n/a |
| UiAutomator (Android) | n/a | new UiSelector().resourceId("...").text("...") |
| XPath | Available on both | Available on both — slow on large hierarchies |
| ID | n/a (use accessibility id) | resource-id |
| CSS selector | n/a for native | n/a for native |
Strongly prefer Accessibility ID. It's stable, performant, and the same attribute drives accessibility on real devices. XPath should be the last resort — Appium's XPath traversal can be very slow on complex screens.
// WDIO example
await $('~login-button').click(); // accessibility id
await $('android=new UiSelector().text("Login")').click();
await $('-ios class chain:**/XCUIElementTypeButton[`name == "Login"`]').click();
For hybrid apps, switch between native and WebView contexts:
const contexts = await driver.getContexts();
// ['NATIVE_APP', 'WEBVIEW_com.example.app']
await driver.switchContext('WEBVIEW_com.example.app');
// now drive the WebView like a regular browser
await $('#submit').click();
await driver.switchContext('NATIVE_APP');
WebView debugging requires Chrome DevTools (Android) or Safari Web Inspector (iOS); set up webviewDebugProxyPort or equivalent capability for the driver to find the WebView pages.
Modern Appium uses W3C-spec touch actions:
await driver.action('pointer', { parameters: { pointerType: 'touch' } })
.move({ x: 200, y: 1200 })
.down()
.pause(100)
.move({ duration: 500, x: 200, y: 400 })
.up()
.perform();
Many client libraries also expose convenience methods (tap, longPress, swipe, pinch) — verify against your specific client library docs. The deprecated TouchAction / MultiTouchAction APIs should be replaced where they still appear.
public class LoginScreen {
private final AppiumDriver driver;
@AndroidFindBy(accessibility = "login-email") private MobileElement email;
@AndroidFindBy(accessibility = "login-password") private MobileElement password;
@AndroidFindBy(accessibility = "login-submit") private MobileElement submit;
public LoginScreen(AppiumDriver d) {
this.driver = d;
PageFactory.initElements(new AppiumFieldDecorator(d), this);
}
public HomeScreen signInAs(String e, String p) {
email.sendKeys(e);
password.sendKeys(p);
submit.click();
return new HomeScreen(driver);
}
}
Use @AndroidFindBy / @iOSXCUITFindBy paired annotations for cross-platform tests. For WDIO, the pattern is the same as desktop POs but with mobile selectors.
Appium Inspector is the GUI for inspecting the live device's element tree. Use it during locator development — it shows the exact accessibility id, resource-id, class chain, etc., for each element. Do not write locators by guess; use Inspector first.
# Install Appium
npm install -g appium
appium driver install uiautomator2
appium driver install xcuitest
# Run server
appium # default port 4723
appium --port 4724 --base-path /wd/hub # alternative port + base path
appium --relaxed-security # allow ADB shell / arbitrary commands (dev only)
Pin Appium and driver versions in CI; major version bumps can change capability defaults.
For Android in CI:
emulator -no-window) — slow startup, slow execution, but workable for smoke.react-native-android / similar pre-baked images.For iOS in CI:
appium: prefix in Appium 2 — fails or silently ignored.noReset: true + shared user accounts → order-dependent flake. Decide per-test.Pixel_7_API_34 works on your machine, not CI. Parameterize.adb shell settings put global window_animation_scale 0 etc.) or stub them in the app for tests.When helping with Appium, ask:
npx claudepluginhub aks-builds/quality-skills --plugin quality-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.