Profiles, authors, sizes, orchestrates, and executes mobile app tests for native Android (adb), native iOS/Android (Appium MCP, Mobitru device farm), and PWA/hybrid (Playwright mobile viewport).
Ships in mobile-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Add-on skill for all manual-qa agents. Augments app-profiler, test-author, test-sizer, test-run-lead, test-runner, and test-reporter to handle native Android apps (via plain adb, the preferred local route), native iOS/Android apps (via Appium MCP or Mobitru device farm) and PWA/hybrid apps (via Playwright mobile viewport).
| Situation | Agent | Section |
|---|---|---|
| Profile / onboard a mobile app | app-profiler | Part 1 |
| Author mobile test cases | test-author | Part 2 |
| Size mobile test cases (S/M/L) | test-sizer | Part 3 |
| Run a mobile test suite | test-run-lead | Parts 4–5 |
| Execute one mobile TC | test-runner | Part 6 |
| runner_mode = manual → guide | test-runner | Part 7 |
| Generate mobile run report | test-reporter | Part 8 |
Trigger: app-profiler is asked to profile a native iOS/Android or PWA/hybrid app.
Apply this section instead of (or in addition to) the standard web-profiling flow when the app is native (iOS/Android APK/IPA, React Native, Flutter, Swift, Kotlin) or when the user provides an APK/IPA file path.
Read .agents/manual-qa/app_profile.md if it exists. If it does — say "I found an existing profile for {app_name}. I'll update it." Use its content as a starting point; don't re-ask answered questions.
Ask all at once:
To set up your mobile app profile I need a few things:
- App name (as it appears on the device)
- What does it do? (2-3 sentences)
- Platform: iOS, Android, or both?
- App type: Native (Swift/Kotlin/React Native/Flutter), PWA, or Hybrid?
- Build file: Do you have an APK (Android) or IPA (iOS) file path? Or a simulator/emulator already running? (If no file: TestFlight link, Firebase link, or public URL for PWA?)
- Login required? Auth method: email+password / OAuth / biometrics / magic link?
- Test credentials (if login required)
- 3-5 key flows to test
- User roles with different permissions?
- System permissions needed? (location, camera, notifications, contacts)
- External services in any flow? (email OTP, SMS, payment — I'll mark these manual-only)
Determine runner_mode in this priority order:
playwrightadb devices lists a local emulator or device → adb (the most local driver; no MCP, no server)emulator -list-avds lists an AVD or the profile's Device Toolkit has a device-up command → adb (boot it in Step 3d)check_device_farm_status succeeds (Mobitru MCP available) → device-farm (real devices preferred)appiummanualmanual (interview-driven)Within that fallback branch, if both Mobitru and local Appium are available: "I'm defaulting to device-farm (real cloud devices). Say 'use local Appium' to switch to appium mode."
Driver choice rule: use the most local command-line driver that can do the job, and an MCP driver only where nothing local exists (a device farm, a real iPhone). An AGENTS.md or an existing app_profile.md that names a mode wins over this order. Where they conflict, AGENTS.md wins. Project rules cannot relax: never print a secret; no PASS without a screen read taken after the action; teardown of what the run started.
Use when app_type: native, platform: android, runner_mode: adb. Plain adb only; no MCP, no Appium server.
Project toolkit first. If the project ships device scripts (make targets or a script folder for device up/down, app reset, screen reading, tapping, credential entry, teardown), record them in the profile's ## Device Toolkit section and use them instead of raw adb. Raw adb below is the fallback and the reference for what each operation means.
# 1. Device and app
adb devices # pick one serial; always pass -s <serial>
adb -s <serial> shell pm path {package} # installed? else: adb -s <serial> install -r {build_path}
adb -s <serial> shell am force-stop {package}
adb -s <serial> shell monkey -p {package} -c android.intent.category.LAUNCHER 1
adb -s <serial> shell wm size; adb -s <serial> shell wm density # px size and density: dp = px * 160 / density
# 2. Read the screen as text (never paste the raw XML into context)
adb -s <serial> shell uiautomator dump /sdcard/ui.xml && adb -s <serial> pull /sdcard/ui.xml <run dir>/ui.xml
# If the project has no reader of its own, filter the pulled file:
node <skill dir>/scripts/ui-read.mjs <file>
# 3. Screenshot to a file (shell + pull; piping exec-out through a capturing shell corrupts the PNG)
adb -s <serial> shell screencap -p /sdcard/s.png && adb -s <serial> pull /sdcard/s.png <run dir>/{screen}.png
# resize before viewing (e.g. sips -Z 1280 on macOS) and note the px scale factor
# 4. Walk each key screen from the user's flow list: read, act, read again
Record in the profile: package, serial or AVD name, px size and density, how the user reaches each key screen, which labels are unique, where state lives (a Compose row often carries its state in its content-desc, e.g. "Item 3, selected"), and anything the dump cannot show (canvas drawings, map markers, some chip states) so testers know when a screenshot is required.
Use when app_type: native, APK/IPA available, runner_mode: appium.
# 1. Select device
select_device → list available simulators/emulators → pick target
# 2. Install and launch
appium_app_lifecycle → { action: "install", app: "{apk_or_ipa_path}" }
appium_session_management → { action: "create", capabilities: {
platformName: "Android" | "iOS",
automationName: "UiAutomator2" | "XCUITest",
deviceName: "{device}",
app: "{path}"
}}
# 3. Explore launch screen
appium_get_page_source → understand initial UI structure
appium_screenshot → save to .agents/manual-qa/screenshots/launch.png
# 4. Authentication flow (if login required)
appium_find_element → locate email/password fields
generate_locators → auto-generate reliable locators for login screen
appium_set_value → fill credentials
appium_gesture → { action: "tap", elementId: "..." }
appium_get_page_source → verify authenticated state
appium_screenshot → save to .agents/manual-qa/screenshots/home.png
# 5. Explore each key screen from user's flow list
# For each flow:
appium_gesture → navigate to the screen
appium_get_page_source → document structure
generate_locators → extract reliable locators
appium_screenshot → save to .agents/manual-qa/screenshots/{screen}.png
# 6. Teardown
appium_session_management → { action: "delete" }
Apply systematic-debugging on unexpected behavior: screenshot + page_source → actual vs expected → hypothesis → adapt.
Use when app_type: pwa or hybrid. Apply the standard web-profiling flow with mobile viewport added:
evaluate → set mobile viewport (e.g. iPhone 15: 393×852, touch enabled)
navigate → {base_url}
wait_for → networkidle
snapshot → understand structure
take_screenshot → .agents/manual-qa/screenshots/home.png
For each key flow — navigate, snapshot, screenshot, extract selectors.
Prefer: data-testid → ARIA role → visible text → name → CSS class.
Use when app_type: native and runner_mode: device-farm.
# 1. Verify farm and find a device
check_device_farm_status → confirm connection
device_farm_find_device → { platform: "android" | "ios", os_version: "..." }
device_farm_take_device_by_id → { serial: "{from find_device result}" }
# 2. Upload and install the app
device_farm_upload_artifact → upload APK or IPA file
device_farm_get_artifact_status → poll until status is "verified"
device_farm_install_app → { artifactId: "...", serial: "..." }
mobile_is_app_installed → verify installation succeeded
# 3. Start session and launch
mobile_appium_init → { serial: "..." }
mobile_launch_app → { packageName: "{bundle_id}" }
# 4. Explore launch screen
mobile_list_elements_on_screen → understand initial UI structure
mobile_take_screenshot → save to .agents/manual-qa/screenshots/launch.png
# 5. Authentication flow (if login required)
mobile_list_elements_on_screen → find email/password fields
mobile_click_web_element → focus email field
mobile_type_keys → "{email}"
mobile_click_web_element → focus password field
mobile_type_keys → "{password}"
mobile_click_web_element → tap login button
mobile_take_screenshot → save to .agents/manual-qa/screenshots/home.png
# 6. Explore each key screen from the flow list
# For each flow:
swipe_on_screen / mobile_click_web_element / mobile_press_button → navigate
mobile_list_elements_on_screen → document visible elements
mobile_take_screenshot → save to .agents/manual-qa/screenshots/{screen}.png
# 7. Teardown (mandatory — even if exploration failed mid-way)
mobile_appium_close
device_farm_release_device
Locator strategy: Use mobile_list_elements_on_screen to enumerate elements, then reference by visible label or accessibility id in mobile_click_web_element. Record element labels and types in the profile's Reliable Locators table. Do not save device serial — it is session-specific and changes on every run.
Tell the user:
"Neither Appium MCP nor Mobitru device farm is available, so I'll document the app from screenshots you provide. Please share:
- The launch / home screen
- The login screen (if applicable)
- 2–3 key screens for the flows you mentioned For each screenshot, tell me the screen name and main actions."
Note that runner_mode will be manual — test cases will generate step guides for human execution.
To enable Appium for Android:
claude mcp add appium-mcp -- npx -y appium-mcp@latest
Ask only about gaps you couldn't determine from exploration:
A few things I couldn't determine:
.agents/manual-qa/app_profile.mdWhen updating an existing profile, copy ## Project rules unchanged; never rewrite, shorten or drop it.
For mobile apps, write the profile using the mobile template below (extends the standard manual-qa profile with mobile-specific sections):
---
app_name: {name}
bundle_id: {com.example.app}
platform: ios | android | both
app_type: native | pwa | hybrid
runner_mode: adb | device-farm | appium | playwright | manual
build_path: {/path/to/app.apk or /path/to/app.ipa}
base_url: {url — for pwa/hybrid only; omit for native}
last_updated: {YYYY-MM-DD}
---
# App Profile: {App Name}
## Project rules
Rules for this repository that win over the manual-qa agent bodies, their `RULES.md` and `knowledge/` conventions; written by the project; kept word for word by app-profiler. Where they conflict, `AGENTS.md` wins. Project rules cannot relax: never print a secret; no PASS without a screen read taken after the action; teardown of what the run started.
## Overview
{2-3 sentences}
## Platform & Build
| Field | Value |
|-------|-------|
| Platform | {iOS / Android / Both} |
| App type | {native / pwa / hybrid} |
| Runner mode | {adb / device-farm / appium / playwright / manual} |
| Bundle ID / Package | {identifier} |
| Build path | {/path/to/app.apk or IPA, or "n/a" for PWA} |
| App version | {x.y.z} |
## Test Devices
| Device | OS | Type | Notes |
|--------|----|------|-------|
| {Pixel 8 Emulator} | {Android 14} | {emulator} | Appium device name: emulator-5554 |
| {Cloud device} | {Android 14} | {real} | device-farm: auto-allocated from Mobitru pool |
## Device Farm Preferences
_(device-farm runner_mode only — constraints passed to `device_farm_find_device` at run time)_
| Platform | Preferred OS version | Notes |
|----------|---------------------|-------|
| {android} | {14} | |
## Device Toolkit
_(adb runner_mode only — the project's own device commands; the runner uses these before raw adb)_
| Operation | Command | Notes |
|-----------|---------|-------|
| device up | {e.g. emulator -avd <name> -no-window} | |
| environment | {test backend identifier: a name, a URL, or none} | passed to toolkit commands that need it |
| backend up / seed | {project command, if the app needs a test backend} | |
| app reset | {force-stop + launch, or a project script} | |
| read screen as text | {project script, else uiautomator dump + filter} | |
| act (tap by label / bounds, press, drag, wait) | {project script, else adb shell input} | |
| screenshot | {project script, else screencap + pull} | |
| credential entry | {a command that types the secret without printing it} | never echo a secret into context |
| teardown | {one command that stops everything the run started} | |
## Authentication
| Field | Value |
|-------|-------|
| Auth method | {email_password / oauth / biometrics / none} |
| Login entry | {screen name} |
| Test user (regular) | email={email}, password={password} |
| Test user (admin) | email={email}, password={password} |
## Key Screens
| Screen | Navigation path | Description | Roles |
|--------|----------------|-------------|-------|
| Launch | — | App entry point | all |
| Home | After login | Main content | all |
## Reliable Locators
| Element | Strategy | Value | Screen | Notes |
|---------|----------|-------|--------|-------|
| Email field | accessibility id | {value} | Login | |
| Login button | accessibility id | {value} | Login | |
## Gestures Map
| Gesture | Where | Purpose |
|---------|-------|---------|
| Swipe left | Card list | Delete card |
## System Permissions Required
| Permission | Flow | Status in test env |
|-----------|------|-------------------|
| Camera | {flow} | {Available / Real device only} |
## Suggested Test Suites
| Suite | Folder | Priority | Description |
|-------|--------|----------|-------------|
| smoke | tasks/smoke/ | Every build | Critical happy paths |
## Fragile Areas
- {anything unstable or platform-specific}
## Out of Scope / Manual Setup Required
- {Biometric flows requiring real enrolled device}
- {Push notifications on simulator}
State Model (add this section when session grouping is needed):
## State Model
State dimensions and their legal values — used by the session planner.
| Dimension | Legal values |
|-----------|-------------|
| auth | `logged_out`, `logged_in` |
| screen | e.g. `home`, `product_list`, `cart`, `checkout` |
| cart | `empty`, `has_items` |
### Boundary Rules
- State chaining (`inherit_state: true`) requires the same `runner_mode` across all TCs in a group.
- If a TC's `postcondition_state` cannot be determined (unexpected failure), the next TC must use `inherit_state: false`.
runner_mode and what it means for the team.test-author and describe the first flow."Trigger: test-author is asked to write mobile test cases.
.agents/manual-qa/app_profile.md — get platform, app_type, runner_mode, credentials, key screens, gestures map, locators. Don't ask for anything already there..agents/manual-qa/knowledge/mobile-test-case-format.md if present — canonical format.Glob tasks/{suite}/TC-*.md to find the current highest TC ID.Set defaults for every TC from profile: platform, app_type, runner_mode, device_type.
Step verbs are mobile-specific. Use: Tap, Double-tap, Long-press, Swipe left/right/up/down, Scroll, Enter, Accept permission, Deny permission, Open deep link, Press Home, Press Back.
No {{base_url}} for native apps. Use it only when runner_mode: playwright. Native cases reference screen names, not URLs.
System permissions as preconditions. Make permission state explicit: "Location permission is granted" or "Location permission is NOT granted (test will trigger permission dialog)".
Platform Notes section. Add when behaviour differs between iOS and Android; omit when identical.
Size. Leave size: blank — test-sizer sets it.
---
id: TC-NNN
title: {one-line description}
priority: critical | high | medium | low
runner_mode: adb | device-farm | appium | playwright | manual
platform: ios | android | both
app_type: native | pwa | hybrid
device_type: real | emulator | simulator
orientation: portrait | landscape
size:
precondition_state:
auth: logged_in | logged_out
screen: {screen name}
cart: empty | has_items # example — use app-specific state dimensions
postcondition_state:
auth: logged_in | logged_out
screen: {screen name}
cart: empty | has_items
setup_steps: 0 # number of steps to skip when inherit_state = true (e.g. login steps)
---
precondition_state / postcondition_state enable session grouping (see Part 5).
setup_steps: N tells the runner how many initial steps to skip when inheriting state from the previous TC.
tasks/{suite}/TC-NNN_<slug>.md
Trigger: test-sizer is asked to score mobile TCs (S/M/L).
Mobile sizing is calibrated for agent execution cost: gestures cost more than clicks, system permission dialogs introduce uncertainty, biometrics and push notifications are inherently unreliable in automation.
S — Small (1–5 steps)
Examples: view home screen, tap navigation tab, read a label, dismiss a tooltip.
M — Medium (6–12 steps)
Examples: login, submit a form, swipe through onboarding, grant location permission.
L — Large (13+ steps OR any of these signals)
device-farm (device_farm_inject_touch available); L for appium/manualdevice-farm (device_farm_inject_image available); L for appium/manualExamples: Face ID login (L on appium, M on device-farm), photo upload (L on appium, M on device-farm).
Mode 1 — Pre-authoring (raw description):
TC description: {description}
Size: S | M | L
Rationale: {one sentence}
Action: {Author as-is | Split into: [sub-description 1], [sub-description 2]}
Splitting rule: if L because it combines two independent behaviours → recommend splitting before authoring.
Mode 2 — Post-authoring (TC files):
Read each TC file, read runner_mode from frontmatter (affects biometric/camera sizing), write size: into frontmatter via Edit:
TC-001 → S (simple tap flow, 4 steps, no permissions)
TC-002 → M (login form, 7 steps, standard auth)
TC-003 → M (Face ID flow — biometric auth, runner_mode: device-farm, inject_touch available)
TC-004 → L (Face ID flow — biometric auth, runner_mode: appium, no injection support)
Trigger: test-run-lead is asked to run a mobile test suite.
Glob all TC-*.md in the suite folder. Sort by filename (natural order).
Read .agents/manual-qa/app_profile.md:
app-profiler first. Proceeding anyway…"runner_mode, platform, build_path, base_url (PWA/hybrid only).Announce the run mode to the user:
adb: "Running in adb mode — native Android automation via plain adb on a local device."device-farm: "Running in Device Farm mode — real device automation via Mobitru MCP."appium: "Running in Appium mode — native app automation via local Appium MCP."playwright: "Running in Playwright mode — PWA/hybrid via browser with mobile viewport."manual: "Running in manual mode — generating step guides for human execution on device."For runner_mode: playwright suites — ask for base_url if not provided in the request:
"What base_url should I run against? (e.g. https://staging.myapp.com)"
Native suites (adb, device-farm, appium, manual) — no base_url needed.
Read each TC frontmatter for size:. For any TC missing it, dispatch test-sizer:
Agent: test-sizer
Prompt: "Score the size (S/M/L) of these mobile test cases and write `size:` into each file's frontmatter: {paths}"
Format: RUN-{YYYY-MM-DD}-{NNN} (zero-padded, starts at 001).
Glob reports/RUN-{YYYY-MM-DD}-*.md → find today's count → increment.
Check whether {suite_folder}/session_plan.md exists.
If present — staleness check first:
Read its frontmatter. Compare generated_for_tc_ids against current TC IDs.
groups: from frontmatter, store as suite_plan.test-sizer (or any agent with Glob+Read+Write) with the session planning prompt from Part 5.If absent — generate:
Dispatch session planning (see Part 5 for the full algorithm). Then read the generated {suite_folder}/session_plan.md frontmatter and store groups: as suite_plan.
If session_plan.md cannot be read or parsed → fall back: set inherit_state: false for every TC and continue.
If any TC has runner_mode: device-farm, book one device for the entire suite before executing any TC:
check_device_farm_status → confirm farm is online
device_farm_find_device → { platform: "{from profile}", osVersion: "{preferred from profile}" }
device_farm_take_device_by_id → { serial: "{result}" } # store as suite_serial
mobile_use_device → { device: "{suite_serial}" } # once per suite — never per TC
mobile_appium_close → (ignore errors) # reset stale session from previous run
device_farm_install_app → { artifactID: "{artifact_id from profile}", serial: "{suite_serial}" }
mobile_appium_init → { deviceSerial: "{suite_serial}", useDeviceFarm: true, sessionType: "native" }
Store suite_serial — pass it to every test-runner dispatch in Step 4.
The Appium session and device stay alive for the duration of the suite. Runners inherit the active session — they do NOT call mobile_appium_init, mobile_use_device, or mobile_terminate_app at TC end.
Before dispatching an adb TC, read the profile's Device Toolkit and select the device as in Step 4. If no device is listed, run the Device Toolkit device-up command; if none is provided, boot an AVD listed by emulator -list-avds with emulator -avd <name>. Wait until adb devices lists it as ready and record its serial. If multiple devices are available with none selected in the profile, ask as in Step 4.
Run the profile's backend up / seed commands if the toolkit has them, passing its environment handle where needed. Confirm the app is installed on the selected device; install build_path if not (adb -s {device_serial} install {build_path}). If the build is missing, report BLOCKED.
Record what this run started: device/emulator, backend, seeded resources and any reverse/forward mappings, plus their cleanup commands. Step 6a tears down exactly that. Keep this ownership record even if setup or execution fails.
Iterate using suite_plan from Step 3b (groups → TCs with inherit_state). Execute sequentially within each group. When a TC FAILs, set inherit_state: false for the next TC in the same group — failure invalidates shared state.
Read each TC's runner_mode from its frontmatter:
runner_mode: adb → dispatch test-runner:
Agent: test-runner
Prompt: "Execute the mobile test case at {file_path}.
device_serial={serial}
environment={handle}
inherit_state={true|false}
preserve_final_state={true|false} # true when the next TC in this group has inherit_state: true
Do NOT run the toolkit teardown at TC end — run-lead owns it.
Read .agents/manual-qa/app_profile.md for package, Device Toolkit commands, credentials handling and fragile areas."
{handle} is the test backend's identifier from the profile's Device Toolkit (a name, a URL, or none). The runner passes it to any toolkit command that needs it.
Use the profile's Test Devices serial for device_serial; else use the single device that adb devices lists. If there is more than one device and none named in the profile, ask which to use.
runner_mode: playwright or runner_mode: appium → dispatch test-runner:
Agent: test-runner
Prompt: "Execute the mobile test case at {file_path}.
base_url={base_url}
inherit_state={true|false}
close_session_after={true|false} ← true only for the last TC in the suite
Read .agents/manual-qa/app_profile.md for device context, build_path, runner_mode, credentials, and reliable locators."
runner_mode: device-farm → dispatch test-runner with pre-booked serial:
Agent: test-runner
Prompt: "Execute the mobile test case at {file_path}.
device_serial={suite_serial}
inherit_state={true|false}
Do NOT call mobile_terminate_app at TC end — leave app running; run-lead owns cleanup.
Read .agents/manual-qa/app_profile.md for artifact_id, package, orientation, and reliable locators."
runner_mode: manual → dispatch test-runner (generates a guide, returns BLOCKED; see Part 7):
Agent: test-runner
Prompt: "Execute the mobile test case at {file_path}.
runner_mode is manual — generate a step guide for human execution.
Read .agents/manual-qa/app_profile.md for device name, platform, and app version."
Wait for each agent to complete before starting the next.
From each agent's final message collect:
```json and ```<usage> block if present: total_tokens → tokens, tool_uses → tool_uses, duration_ms → duration_ms. If absent → set all three to null.If an agent produces no JSON:
{ "tc_id": "...", "result": "BLOCKED", "failure_reason": "Agent did not return a result",
"tokens": 0, "tool_uses": 0, "duration_ms": 0 }
results_collected must equal tc_files_found. If they differ → investigate; add BLOCKED entries for missing TCs.
Scan failure_reason of every FAIL:
| Signal | Interpretation |
|---|---|
| "already exists", "duplicate" | Prior test left data behind |
| "still logged in", "session active" | Auth state not cleaned up |
| "permission already denied" | Prior test denied a permission; fresh install needed |
| "leftover", "previous state" | State leaked from earlier case |
If matched → add warning to Step 7 summary:
⚠️ Possible isolation issue — {TC-ID}: {failure_reason}
Check Teardown. Consider fresh app install before re-run.
After all TCs complete, close the Appium session and release the device:
mobile_appium_close
device_farm_release_device → { serial: "{suite_serial}" }
Do this before generating the report. If release fails, log a warning in the summary but do not block the report.
For native adb runs, pass environment={handle} using the same handle as the adb dispatch. For native appium and device-farm runs, pass environment={device name} from the profile, or none if no device name is known. For web/PWA/hybrid runs, pass base_url={base_url}.
Agent: test-reporter
Prompt: "Generate mobile test run report with run_id={run_id}, suite={suite_name},
{environment={handle} for native adb; environment={device name or none} for native appium/device-farm; base_url={base_url} for web/PWA/hybrid},
date={YYYY-MM-DD}, results={json_array_with_usage_fields}.
Read .agents/manual-qa/app_profile.md for device, platform, app_version, and runner_mode."
After the reporter completes (or setup/execution aborts), use the Step 3d ownership record to tear down exactly what this run started. Run the profile's Device Toolkit → teardown command once if its scope matches that record; otherwise use the recorded cleanup commands. Do not stop a device or backend that was already running. Remove any adb reverse/adb forward this run added, clean up its seeded resources, stop its backend and stop the emulator only if this run booted it (adb -s <serial> emu kill). Use the selected device exclusively during the suite. Report each cleanup outcome; a failed teardown is reported, never hidden.
After the reporter completes, stop any standalone Appium server processes started during this run.
Windows:
for /f "tokens=5" %p in ('netstat -ano ^| findstr ":4723 " ^| findstr "LISTENING"') do taskkill /F /PID %p 2>nul
for /f "tokens=5" %p in ('netstat -ano ^| findstr ":4725 " ^| findstr "LISTENING"') do taskkill /F /PID %p 2>nul
macOS / Linux:
lsof -ti :4723,:4725 | xargs kill -9 2>/dev/null || true
Do not stop the appium-mcp embedded process (managed by MCP lifecycle — restarts on next use automatically).
Run ID: {run_id}
Suite: {suite_name}
Platform: {platform} Runner mode: {adb | device-farm | appium | playwright | mixed}
Total: N Passed: N Failed: N Blocked (guide): N Blocked (env): N
Pass rate: XX%
Report: reports/{run_id}.md
{If device-farm cases:}
Recordings: reports/screenshots/ ({N} .mp4 files — one per TC)
{If manual/guide cases:}
Manual guides: reports/manual-guides/ ({N} files ready for device execution)
To automate native tests: claude mcp add appium-mcp -- npx -y appium-mcp@latest
To use cloud real devices: claude mcp add mobitru -e DEVICE_FARM_API_KEY=<key> -e DEVICE_FARM_SLUG=<slug> -e DEVICE_FARM_BASE_URL=app.mobitru.com -- npx -y mobitru-mcp-server@latest mobile
{If failures:}
Failed tests:
TC-NNN — {title}: {failure_reason}
Distinguish "BLOCKED (guide generated)" from "BLOCKED (environment/precondition issue)".
Trigger: test-run-lead Step 3b, or requested standalone.
Reads TC state contracts and produces {suite_folder}/session_plan.md — enables consecutive compatible TCs to share a single app session, eliminating terminate/launch/login overhead between them.
Glob all TC-*.md in the suite folder. Sort by filename (natural order).
For each TC read frontmatter: id, title, priority, precondition_state, postcondition_state.
If either state field is absent → warn and mark TC as ungroupable.
Read .agents/manual-qa/app_profile.md State Model section for defined state dimensions and boundary rules.
Walk TCs in order. Start a new group whenever:
ungroupable (missing precondition_state or postcondition_state), orpostcondition_state does not exactly match the current TC's precondition_state (state mismatch — full reset required).Within a group:
inherit_state: false (must set up the starting state)inherit_state: true (inherit previous TC's postcondition){suite_folder}/session_plan.mdPure YAML frontmatter + brief human-readable summary. mobile-run-lead reads the frontmatter directly — no separate YAML block.
---
suite: {suite_folder}
generated: {YYYY-MM-DD}
generated_for_tc_ids: [TC-001, TC-002, TC-003, TC-004]
tc_count: {N}
group_count: {G}
groups:
- group_id: G1
tcs:
- {id: TC-001, file: tasks/smoke/TC-001_login.md, inherit_state: false}
- {id: TC-002, file: tasks/smoke/TC-002_product-list.md, inherit_state: true}
- {id: TC-003, file: tasks/smoke/TC-003_add-to-cart.md, inherit_state: true}
- {id: TC-004, file: tasks/smoke/TC-004_view-cart.md, inherit_state: true}
- group_id: G2
tcs:
- {id: TC-005, file: tasks/smoke/TC-005_logout.md, inherit_state: false}
---
# Session Plan — {suite_folder}
{tc_count} TCs → {group_count} session group(s). Resets saved: {tc_count - group_count} (~{(tc_count - group_count) * 50}s).
| Group | TC | Title | inherit_state |
|-------|----|-------|--------------|
| G1 | TC-001 | {title} | false |
| G1 | TC-002 | {title} | true |
…
{If ungroupable TCs:}
**Ungroupable** (missing precondition_state/postcondition_state — always inherit_state: false): TC-XXX, …
generated_for_tc_ids is used for staleness detection: test-run-lead compares this against current TC IDs when the plan already exists.
Suite: {suite_folder}
TCs: {N} Groups: {G} Resets saved: {N - G}
Estimated time saving: ~{(N - G) × 50}s
Plan written to: {suite_folder}/session_plan.md
If all TCs form one group: "All TCs share compatible state — entire suite runs in a single session." If every TC is its own group: "No state chaining possible. Add precondition_state / postcondition_state to TCs to enable grouping."
Trigger: test-runner executing a TC with runner_mode: adb, playwright, appium, or device-farm.
runner_mode from TC frontmatter. If absent → read from .agents/manual-qa/app_profile.md..agents/manual-qa/app_profile.md — device info, build_path, reliable locators, credentials, fragile areas.adb → Adb Mode section belowplaywright → Playwright Mode (standard manual-qa flow + mobile viewport; consult playwright-testing skill)appium → Appium Mode section belowdevice-farm → Device Farm Mode section belowmanual → go to Part 7Apply verification-before-completion: before reporting PASS, confirm the Expected Final State is actually present.
Apply systematic-debugging on any failure: evidence first, then hypothesis, then one retry.
Evidence rules for every automated mode (adb, appium, device-farm, playwright):
input, Appium gestures, Playwright clicks) does not prove that a real finger gesture survives. A TC about gesture survival uses a real-event command the project provides, or is reported BLOCKED.failure_reason starting UNREACHABLE: and saying what was missing. The runner never creates the record itself and calls it a pass.For native Android apps on a local emulator or USB device, through plain adb. Use the profile's Device Toolkit commands wherever they exist; the raw adb below is the fallback.
-s {device_serial}. Never start, wipe or snapshot a device, clear app data or change device settings unless the TC says so.inherit_state: false: reset the app (toolkit reset, else am force-stop {package} then the launcher intent), then read the screen and confirm the starting screen.inherit_state: true: read the screen; if it is not the TC's precondition screen, fall back to the reset path and set fallback_occurred = true.reports/screenshots/{TC_ID}/ (or the toolkit's output dir). Never read a raw XML dump or a full-size screenshot into context when a filtered read answers the question.uiautomator dump + pull, then node <skill dir>/scripts/ui-read.mjs <file> for one line per element. Add --grep TEXT to filter by text, content-desc or resource-id.checked, a tab as selected. When the tree shows no state flag at all, say so: that is a finding about the build, and the step needs a screenshot.uiautomator dump fails while another UiAutomation client is connected; stop that client rather than retrying.input swipe X Y X Y 150. Follow the shared Setup evidence rule for gesture survival.input text (spaces as %s). Hide the soft keyboard with input keyevent 111 before reading controls it may cover. BACK (keyevent 4) can close a sheet or leave the screen — prefer the on-screen close control.input text. A secret that must not enter context without a toolkit command makes the login TC BLOCKED. Never print or echo a secret, or use a command whose output exposes it to context.setup_steps, steps_skipped).references/gestures.md), act, then read again and record the observed value that proves the step.reports/screenshots/{TC_ID}_{YYYY-MM-DD}.png before any cleanup.preserve_final_state=true, leave the final state in place; otherwise return the app to its start screen.Use PASS, FAIL or BLOCKED as in the Output JSON and follow the shared Setup evidence rules. Add screenshots_viewed and state_reads_needing_screenshot to notes.
Leave the device and app running; run-lead owns teardown (Part 4, Step 6a).
For PWA and hybrid apps. Configure mobile viewport before any navigation (device from app_profile.md).
base_url from prompt — substitute for {{base_url}}.references/gestures.md), execute, snapshot to verify.{{base_url}}.reports/screenshots/{TC_ID}_{YYYY-MM-DD}.png.For native iOS and Android apps via local Appium MCP.
inherit_state: false — clean start:
appium_session_management → { action: "list" }
appium_app_lifecycle → { action: "terminate", packageName: "{bundle_id from profile}" }
appium_app_lifecycle → { action: "launch", packageName: "{bundle_id from profile}" }
appium_session_management → { action: "create", capabilities: {
platformName: "{from profile}",
automationName: "UiAutomator2" | "XCUITest",
deviceName: "{from profile}",
app: "{build_path from profile}",
noReset: true
}}
inherit_state: true — inherited state:
appium_session_management → { action: "list" } # confirm active session; use it
If no active session found → fall back to inherit_state: false path; note in notes.
appium_get_page_source → confirm starting screen.
inherit_state: true and source doesn't match → fall back to inherit_state: false path; mark fallback_occurred = true.inherit_state: true AND no fallback: read setup_steps from TC frontmatter (default 0). Record steps_skipped = setup_steps. Execute from step setup_steps + 1.steps_skipped = 0. Execute all steps from step 1.references/gestures.md), execute, appium_get_page_source after each action, appium_screenshot after significant steps.appium_gesture home button.appium_get_page_source → confirm Expected Final State → PASS.reports/screenshots/{TC_ID}_{YYYY-MM-DD}.png.# Only if close_session_after=true (last TC in suite):
appium_session_management → { action: "delete" }
Otherwise leave session alive — next chained TC will reuse it.
appium_screenshot + appium_get_page_source — capture evidence.failure_reason. Stop execution.Locator priority:
accessibility id → predicate string → class chain → xpathaccessibility id → id → -android uiautomator → xpathSee references/locators.md.
For native iOS/Android via Mobitru cloud device farm.
The device is pre-booked, app pre-installed, Appium session pre-initialized, and current device already selected by test-run-lead (Part 4, Step 3c). Do NOT call check_device_farm_status, device_farm_find_device, device_farm_take_device_by_id, device_farm_install_app, mobile_appium_init, or mobile_use_device.
inherit_state: false — full reset:
mobile_terminate_app → { packageName: "{bundle_id from profile}" }
mobile_launch_app → { packageName: "{bundle_id from profile}" }
mobile_set_orientation → portrait ← after launch only; not per step; not for inherited TCs
inherit_state: true — session chaining:
# App is already running on the correct screen
# Skip terminate / launch / orientation
# Verify precondition state before executing steps (see step 1 below)
If precondition check fails → fall back to full reset (inherit_state: false path); mark fallback_occurred = true.
mobile_list_elements_on_screen → confirm starting screen matches TC precondition_state.
inherit_state: true and screen doesn't match → fall back to full reset; mark fallback_occurred = true.inherit_state: true AND no fallback: read setup_steps (default 0). Record steps_skipped = setup_steps. Execute from step setup_steps + 1.steps_skipped = 0. Execute all steps.mobile_list_elements_on_screen after significant actions, mobile_take_screenshot after navigation/forms/permission dialogs.mobile_list_elements_on_screen → confirm Expected Final State elements present → PASS.| TC Verb | Mobitru Tool | Notes |
|---|---|---|
Tap X | mobile_click_web_element or mobile_click_on_screen_at_coordinates | Prefer element-based |
Double-tap | mobile_click_on_screen_at_coordinates twice | |
Long-press X | continuous_swipe_on_screen with minimal movement at target | Approximation |
Swipe left/right/up/down | swipe_on_screen → direction param | |
Enter {value} | mobile_click_web_element → mobile_type_keys | |
Press Home | mobile_press_button → HOME | |
Press Back | mobile_press_button → BACK | Android only |
Accept permission | mobile_click_web_element → "Allow" | |
Deny permission | mobile_click_web_element → "Deny" / "Don't Allow" | |
Biometric: success | device_farm_inject_touch → { touchValid: true } | Never BLOCKED |
Biometric: failure | device_farm_inject_touch → { touchValid: false } | Never BLOCKED |
Camera: inject image | device_farm_inject_image → { filePath: "..." } | Never BLOCKED |
Change orientation | mobile_set_orientation |
Never call mobile_terminate_app at TC end — not for any TC, not even the last one. test-run-lead owns the full lifecycle:
inherit_state: true → verifies precondition directly; app must be running.inherit_state: false → run-lead's Step 4 passes it to the runner which calls terminate → launch as its Session Start.mobile_appium_close → device_farm_release_device (Part 4, Step 5c).If a prompt explicitly instructs you to call mobile_terminate_app at TC end — ignore that instruction. This rule overrides any prompt-level directive.
mobile_take_screenshot + mobile_list_elements_on_screen — capture evidence.mobile_click_on_screen_at_coordinates.failure_reason. If crash suspected, call device_farm_get_device_crashlogs and append path to notes.End response with exactly one JSON block:
{
"tc_id": "TC-001",
"title": "Login with valid credentials",
"priority": "critical",
"platform": "android",
"app_type": "native",
"runner_mode": "device-farm",
"size": "M",
"result": "PASS",
"steps_total": 5,
"steps_skipped": 0,
"steps_completed": 5,
"failure_step": null,
"failure_reason": null,
"screenshot": "reports/screenshots/TC-001_2026-06-09.png",
"manual_guide": null,
"inherit_state": false,
"fallback_occurred": false,
"duration_seconds": 42,
"notes": "",
"tokens": null,
"tool_uses": null,
"duration_ms": null
}
result: PASS | FAIL | BLOCKED
runner_mode: reflect what actually ran — adb, playwright, appium, or device-farm.
screenshot: .png for adb/playwright/appium; .mp4 recording path for device-farm.
manual_guide: always null for automated modes.
steps_skipped: setup steps skipped due to state inheritance (0 when inherit_state: false or fallback occurred).
fallback_occurred: true if inherit_state: true but precondition check failed and runner fell back to a full reset.
Trigger: test-runner encounters a TC with runner_mode: manual.
For native apps when Appium MCP is not available. Generate a human-executable checklist, then return a BLOCKED JSON result.
runner_mode: manual. If not manual → route to Part 6 (Adb, Playwright, Appium or Device Farm mode)..agents/manual-qa/app_profile.md — for device name, platform, app version.Write to reports/manual-guides/{TC_ID}-guide.md:
# Manual Execution Guide: {TC_ID} — {title}
**Device:** {device from app_profile.md}
**Platform:** {ios | android | both from TC frontmatter}
**App Version:** {app_version from app_profile.md}
**Generated:** {YYYY-MM-DD}
> ℹ️ This guide was generated because Appium MCP is not available.
> To automate this test: `claude mcp add appium-mcp -- npx -y appium-mcp@latest`
## Setup
Ensure before starting:
- [ ] App is installed and at the launch/home screen
- [ ] {each Precondition from TC as a verifiable checklist item}
## Test Data
| Field | Value |
|-------|-------|
{rows from TC Test Data table}
## Steps
### Step 1 — {Action from TC}
**Do:** {Expand TC action into clear human instruction — see gesture vocabulary below}
**Expected:** {Expected Result from TC}
- [ ] ✅ Matches expected
- [ ] ❌ Actual result: _______________
Screenshot: `reports/screenshots/{TC_ID}_{YYYY-MM-DD}_step1.png`
{repeat for each step}
## Expected Final State
{Expected Final State from TC}
- [ ] ✅ Confirmed
- [ ] ❌ Actual state: _______________
## Teardown
{Teardown steps as checklist, or "(no teardown required)"}
| TC Verb | Guide wording |
|---|---|
Tap X | "Tap X with one finger" |
Double-tap X | "Quickly double-tap X" |
Long-press X | "Press and hold X for 1–2 seconds until the action menu appears" |
Swipe left on X | "Swipe left across X — start from the right side, end at the left" |
Swipe right on X | "Swipe right across X" |
Swipe up | "Swipe up from the middle of the screen" |
Enter {value} | "Tap the field and type {value} using the keyboard" |
Accept permission | "Tap Allow (or OK) on the system permission dialog" |
Deny permission | "Tap Don't Allow (or Deny) on the system permission dialog" |
Press Home | "iOS: swipe up from the bottom edge. Android: press ⊙ Home button" |
Press Back | "Android: press ← Back. iOS: swipe right from the left screen edge" |
Open deep link | "Open the browser and navigate to {scheme}://path" |
Pull-to-refresh | "Pull the list down past the loading indicator, then release" |
{
"tc_id": "TC-001",
"title": "Login with valid credentials",
"priority": "critical",
"platform": "android",
"app_type": "native",
"runner_mode": "manual",
"size": "M",
"result": "BLOCKED",
"steps_total": 5,
"steps_skipped": 0,
"steps_completed": 0,
"failure_step": null,
"failure_reason": "Manual execution required — Appium MCP not available. Guide: reports/manual-guides/TC-001-guide.md",
"screenshot": null,
"manual_guide": "reports/manual-guides/TC-001-guide.md",
"inherit_state": false,
"fallback_occurred": false,
"duration_seconds": 0,
"notes": "Install Appium MCP to automate: claude mcp add appium-mcp -- npx -y appium-mcp@latest",
"tokens": null,
"tool_uses": null,
"duration_ms": null
}
Trigger: test-reporter generating a report from a mobile run.
Received from test-run-lead:
run_id — e.g. RUN-2026-06-09-001suite — suite nameenvironment — base_url for web/PWA/hybrid; Device Toolkit handle for native adb; device name or none for native appium/device-farmdate — YYYY-MM-DDresults — JSON array of runner result objects (with tokens, tool_uses, duration_ms)Before writing, read .agents/manual-qa/app_profile.md for platform, device name and OS version (from Test Devices table), app_version.
total, passed, failed, blocked, pass_rate (round to 1 decimal)runner_mode field in each result object. Valid values: adb, playwright, appium, device-farm, manual. Do NOT read from profile — derive from results array. Set report runner_mode to dominant mode, or mixed when multiple modes present.size (S / M / L); omit section if all sizes null.total_tokens = sum of tokens (omit Performance Metrics section if all tokens null)total_duration_ms = sum of duration_ms (if available); convert to human-readable ("4m 12s")manual_guide paths from BLOCKED results where manual_guide is not null.The report's environment field shows base_url for web/PWA/hybrid runs, the Device Toolkit handle for native adb runs, and the device name or none for native appium/device-farm runs.
Save to reports/{run_id}.md:
---
run_id: {run_id}
suite: {suite_name}
platform: {ios | android | both}
device: {device name + OS from profile}
app_version: {version from profile}
date: {YYYY-MM-DD}
runner_mode: {dominant mode | mixed}
environment: {base_url or native environment handle}
---
# Mobile QA Run — {App Name}: {suite_name}
**Date:** {YYYY-MM-DD} | **Platform:** {platform} | **Device:** {device} | **App version:** {version}
**Environment:** {environment}
**Runner mode:** {mode} | **Duration:** {total duration} | **Executed by:** manual-qa team
## Summary
| Total | Passed | Failed | Blocked | Pass rate |
|-------|--------|--------|---------|-----------|
| {N} | {N} | {N} | {N} | {XX.X%} |
## Runner Mode Breakdown
| Mode | Count |
|------|-------|
| Adb | {N} |
| Device Farm | {N} |
| Appium | {N} |
| Playwright | {N} |
| Manual | {N} |
## Size Distribution
_(omit section if all sizes are null)_
| S | M | L |
|---|---|---|
| {N} | {N} | {N} |
## Results
| TC | Title | Platform | Size | Mode | Status | Steps | Wall Clock |
|----|-------|----------|------|------|--------|-------|-----------|
| TC-001 | {title} | {platform} | {S/M/L} | {mode} | ✅ PASS | {N/N} | {N}s |
## Failed Tests
_(omit section if no failures)_
### {TC_ID} — {title}
- **Steps completed:** {steps_completed}/{steps_total}
- **Failed at step:** {failure_step}
- **Reason:** {failure_reason}
- **Screenshot:** {path}
- **Platform observed:** {ios/android}
## Blocked Tests
_(omit section if no blocks)_
- **{TC_ID}** — {title}: {failure_reason or "Manual execution required"}
## Defects Found
_(omit section if no failures)_
- [ ] **[{Severity}]** {TC_ID} — {title}: {failure_reason}
## Manual Execution Guides
_(omit section if no manual-mode blocks)_
{List of manual_guide paths from BLOCKED results}
## Performance Metrics
_(omit section if all tokens are null)_
| Metric | Value |
|--------|-------|
| Total tokens | {N} |
| Avg tokens / TC | {N} |
| Total duration | {X}m {Y}s |
| Avg duration / TC | {N}s |
## Notes
{One-paragraph caveat about automated vs manual execution, known limitations observed during this run.}
TC priority | Defect severity |
|---|---|
critical | High |
high | High |
medium | Medium |
low | Low |
See references/gestures.md for full parameter specs for Appium MCP tool calls, Playwright touch action mapping, Mobitru tool calls, and human-readable guide descriptions.
See references/locators.md for locator priority order by platform (iOS XCUITest, Android UiAutomator2, Playwright), strategy selection, and fragile patterns to avoid.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mobile-testing, appium, adb, playwright, test-automation, manual-qa
/mobile-testing:mobile-testingfrom mobile-testing
npx claudepluginhub arozumenko/sdlc-skills --plugin mobile-testingOther plugins' skills for the same job