agentleFS
godhiraj-codegodhiraj-code/greenbuild-plugin/skills/mobile-automation/SKILL.md

mobile-automation

Skill1 starsChanged 28 days agoMITView on GitHub

Set up, write, and debug mobile UI tests with Appium (UiAutomator2, XCUITest drivers), Maestro YAML flows, and native Espresso/XCUITest, and pick the right tool per team.

  • Pipes a download into a shell
  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use XCUITestOptions for iOS (platformVersion, udid, bundleId or app path).

    line 31
  2. Distinctive:

    Use explicit waits (WebDriverWait).

    line 35
  3. Very specific:

    Use W3C Actions or mobile: gestures (e.g.

    line 37
  4. Very specific:

    Run maestro test flows/ (pass -e PASSWORD=...).

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mobile automation

1. Choose the tool

  • Appium: cross-platform, any language, works with existing Selenium skills. Best for large suites and device clouds.
  • Maestro: YAML flows, quick to write, built-in waits/retries. Best for smoke and E2E flows owned by mixed teams.
  • Espresso (Android) / XCUITest (iOS): native, fastest and most stable, but the app's own devs have to own them.

2. Appium setup (current npm release is Appium 3.x; driver commands are the same as in 2.x)

node -v   # Appium 3 needs Node ^20.19 || ^22.12 || >=24
npm i -g appium
appium driver install uiautomator2   # Android
appium driver install xcuitest       # iOS (macOS + Xcode)
appium driver doctor uiautomator2    # check env (ANDROID_HOME, JDK)
appium                               # server on http://127.0.0.1:4723 (no /wd/hub since v2)

Python client (pip install Appium-Python-Client):

from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.webdriver.common.appiumby import AppiumBy
opts = UiAutomator2Options()
opts.app = "/path/app.apk"; opts.device_name = "emulator-5554"
opts.auto_grant_permissions = True
driver = webdriver.Remote("http://127.0.0.1:4723", options=opts)
driver.find_element(AppiumBy.ACCESSIBILITY_ID, "login").click()

Use XCUITestOptions for iOS (platformVersion, udid, bundleId or app path).

3. Appium good practice

  • Locator priority: accessibility id > resource-id / iOS predicate or class chain > XPath (last resort). Ask the devs to add test IDs.
  • Use explicit waits (WebDriverWait). Avoid implicit waits plus sleeps.
  • Reset state on purpose: noReset/fullReset, or clear app data per test. Use deep links to skip set-up screens.
  • Use W3C Actions or mobile: gestures (e.g. mobile: swipeGesture on UiAutomator2) instead of the removed TouchAction API.
  • Capture screenshots, page source and device logs on failure.

4. Maestro

curl -fsSL "https://get.maestro.mobile.dev" | bash
appId: com.example.app
---
- launchApp:
    clearState: true
- tapOn: "Sign in"
- inputText: "user@example.com"
- tapOn:
    id: "password"
- inputText: ${PASSWORD}
- assertVisible: "Welcome"

Run maestro test flows/ (pass -e PASSWORD=...). Use maestro studio to inspect elements and runFlow to share sub-flows.

5. Native

  • Espresso: ./gradlew connectedAndroidTest. Use IdlingResources for async work.
  • XCUITest: xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 16'. Use accessibilityIdentifier.

6. Debug checklist

Stale element? Re-find it after navigation. Keyboard covering the element? Hide the keyboard. Different behavior on a real device? Check permissions dialogs and the OS version. Slow session start? Pre-install the app or use a device cloud.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.