Ios device qa

From phatblat/dotfiles · View interactive version

Ios device qa is an AI agent skill from the GitHub repository phatblat/dotfiles. Use when asked to test an iOS app on a physical iPhone over USB or find bugs on the device. Drives SwiftUI QA through an in-app HTTP bridge; not for simulator or XCTest.

How to use this skill

Skill file

iOS Device QA

Drives a real iPhone over the USB CoreDevice tunnel. The app under test embeds a

loopback-only StateServer; a Mac-side daemon proxies to it and mints

capability-scoped tokens. No simulator, no XCTest, no WebDriverAgent.

Runtime

The runtime lives at ~/dev/apple/ios-agent-qa — daemon, Swift/ObjC bridge

templates, and the swift-syntax accessor codegen. **Read that repo's README.md

first**; it is the source of truth for setup, capability tiers, and the Tailscale

ACL shape. Do not work from memory.

Prerequisites: macOS with Xcode (devicectl, swift >= 5.9), bun >= 1.1, an

iPhone paired over USB, and app source containing at least one @Observable

class.

Loop

  1. Codegen. Walk the app source for @Observable classes, then

bun run gen-accessors. First run builds swift-syntax (2-5 min); later runs

are content-hash cached.

  1. Bridge. Add the DebugBridge SPM dependency, gated

.when(configuration: .debug), and wire it from the @main App init inside

#if DEBUG. Build and install to the device; launch via devicectl.

  1. Daemon. Start bin/ios-agent-qa-daemon. It takes an exclusive flock, then

immediately rotates the app's boot token so anything scraping os_log holds a

dead credential within seconds.

  1. Drive. Each iteration: GET /screenshot → GET /elements →

GET /state/snapshot → decide → POST /session/acquire → act via /tap,

/swipe, /type, or a /state/<key> write → re-screenshot → compare →

POST /session/release.

Record a finding whenever observed behavior diverges from the intent of the

screen you are on. Screenshot before and after every state-changing action, so

the report carries evidence rather than assertion.

Rules

daemon's job, and only the daemon validates identity against tailscaled.

action through visible UI and never use /state/* writes to skip steps.

debug-only targets and CI runs swift build -c release. Do not rely on manual

cleanup to keep the bridge out of a shipping build.

Failure modes

| Symptom | Cause | Action |

|---|---|---|

| connection refused to daemon | daemon died | Re-run; the spawn lock fails closed |

| 403 identity_not_allowed | identity not allowlisted | bin/ios-agent-qa-mint grant --remote <id> |

| 409 schema_mismatch | snapshot from an older build | Discard and re-capture |

| 503 device_disconnected | USB tunnel dropped | Reconnect; daemon retries within 30s |

| 429 rate_limited | >10 mints/min for one identity | Wait 60s; check the audit log |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.