sim-use
AGENTS.md1.4k starsChanged 4 months agoApache-2.0View on GitHub
The FB* XCFrameworks are static archives built without library evolution — build_products/ is locked to the toolchain that produced it. Re-run ./scripts/build.sh dev after switching Xcode versions. make test runs swift test --enable-code-coverage — unit tests that exercise parsing, outline rendering, daemon protocol, and cross-platform dispatch without a live simulator. When xcsift is installed (brew install xcsift — optional, never required), make build / make test condense swift output into a TOON summary plus a coverage report. SIM_USE_XCSIFT=0 make test…
- Installs packages
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about lycorp-jp/sim-use
- exafyltd/vitana-platform“feat(e2e): integrate sim-use device-testing layer — eyes+hands on iOS Simulator / Android”GitHub · Jul 13, 2026 · 1 reactions
- sudosubin/agents.nix“agent-skills.github.lycorp-jp.sim-use: init at 0.14.0”GitHub · Sep 29, 2026
- appium/appium-mcp“Token compression”GitHub · Jul 14, 2026
The biggest 3 of 3 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,691 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bump-version-devSkill
- releaseSkill
- run-evalsSkill
- sim-useSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Follow Swift best practices and match the style of surrounding code.
- Very specific: line 6
When adding or removing commands/options, update the README and skills/sim-use/SKILL.md.
- Very specific: line 41
When xcsift is installed (brew install xcsift — optional, never required), make build / make test condense swift output into a TOON summary …
- Distinctive: line 89
After any non-trivial change, at minimum:
- Very specific: line 121
Cross-platform: write IOSSim<Verb>Command + Android<Verb>Command, plus a top-level forwarder in Sources/SimUse/Commands/<Verb>.swift.
- Very specific: line 122
iOS-only: write IOSSim<Verb>Command, register in IOSSimCommand only.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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.
Files
Development Rules
Code quality
- No
Anytypes unless absolutely necessary; upgrade dependencies rather than downgrading code to work around type errors. - Follow Swift best practices and match the style of surrounding code.
- When adding or removing commands/options, update the README and
skills/sim-use/SKILL.md. If the Skill starts relying on behavior newer than its current compatibility floor, also bumpMINIMUM_SIM_USE_VERSIONinskills/sim-use/scripts/preflight.pyand extendPreflightScriptTests.
Changelog
CHANGELOG.md follows Keep a Changelog. Add entries under ## [Unreleased] as you land changes. Subsection order: ### Added / ### Changed / ### Fixed / ### Removed. Never modify already-released version sections.
Build and test
First-time setup
brew install xcodegen # idb generates its Xcode project with XcodeGen
./scripts/build.sh dev # clone idb, build XCFrameworks
make build # build sim-useThe FB* XCFrameworks are static archives built without library evolution —
build_products/ is locked to the toolchain that produced it. Re-run
./scripts/build.sh dev after switching Xcode versions.
Daily workflow
make build # incremental build
.build/debug/sim-use describe-ui --device $UDID # test against a booted simulatorRunning tests
make test # unit tests (no simulator needed)
swift test --filter TapTests # run a single test suitemake test runs swift test --enable-code-coverage — unit tests that exercise parsing, outline rendering, daemon protocol, and cross-platform dispatch without a live simulator.
When xcsift is installed (brew install xcsift — optional, never required), make build / make test condense swift output into a TOON summary plus a coverage report. SIM_USE_XCSIFT=0 make test forces plain swift output.
End-to-end tests (live device)
make e2e # BOTH iOS + Android in sequence (needs a booted sim AND an emulator)
make e2e-ios # iOS only — booted simulator + Playground fixture
make e2e-android # Android only — reachable device/emulator + Playground fixture
make e2e-matrix # iOS across Xcode 26/27 × Device Hub closed/open legs (~35 min default)
make eval # agent evals (real `claude -p` cost; prompts before running)Run the Android emulator headless (-no-window) for video work.
screenrecord only produces frames while SurfaceFlinger is compositing, and
with a windowed emulator that depends on the window being genuinely visible —
frames stop when it is on another Space or occluded, which makes any
automation of capture unreliable. Headless uses offscreen rendering and is
stable. Measured over 5 s of sustained interaction:
| GPU | window | frames |
swiftshader_indirect | visible | 2 |
host | visible | 110 |
host | on another Space | 1 |
swiftshader_indirect | -no-window | 31 |
Note the failure is the window, not the GPU mode: hardware rendering with an invisible window is as dead as software rendering.
The video E2E suites pass either way, and legitimately so — they run against
a still playground screen, and screenrecord is strictly variable-frame-rate,
so a still screen yields exactly one opening frame whether or not capture is
healthy (measured: 29,804 bytes / 1 frame headless vs 29,724 / 1 windowed,
near byte-identical). No assertion can separate the two without driving
sustained motion, and doing that from a test is itself enough to knock the
emulator off adb mid-suite. So if Android video capture ever looks empty,
check how the emulator was booted before suspecting the code.
E2E suites compile always but skip unless SIM_USE_E2E=1 (iOS) / SIM_USE_E2E_ANDROID=1 (Android) is set — make test never touches a device, which is why CI needs no simulator. The runners set those vars for you.
Budget the time: a full green make e2e-ios run is ~15 minutes. The iOS suites drive real HID gestures and wait on simulator animations/keyboard settling, so per-suite waits dominate — this is expected, not a hang. make e2e (both platforms) is ~20+ min. When you only touched one platform, run just that platform's target. The runners keep going past a failed suite and print a full pass/fail map at the end, so read the summary rather than assuming the first red aborted the rest.
make e2e-matrix validates the host-environment matrix: Xcode 26.x / 27.x × Device Hub closed at boot (*-sim legs — the Simulator.app workflow, legacy HID) or open at boot (*-hub legs — CoreDevice dtuhidd HID). One leg runs the full suite (default x27-hub; ARGS="--full <leg>|all|none"), the rest run the smoke tier (scripts/test-runner.sh --smoke: describe-ui, tap, type, scroll); legs whose Xcode is missing are skipped. The package builds once on the xcode-select toolchain — each leg only swaps the runtime Xcode via SIM_USE_TEST_DEVELOPER_DIR and boots a device matching its iOS generation, with dtuhidd/transport gates before and after the suites so a choreography failure cannot green-run the wrong combination. It quits Device Hub and shuts down every booted simulator, so never run it alongside other simulator work. Per-leg logs + evidence: .build/e2e-matrix/<timestamp>/.
Agent-facing behaviour (the bundled skill) has its own natural-language eval layer — see e2e/agent-evals/README.md and docs/ai/xxxx-e2e-confidence-suite/.
Verifying a change
After any non-trivial change, at minimum:
make buildsucceeds.make testpasses.- Spot-check the affected command on a live simulator (
describe-ui,tap @N,screenshot).
Module layout
Five SwiftPM targets; dependency graph flows in one direction.
| Target | Path | Depends on |
SimUseCore | Sources/SimUseCore/ | Foundation + ArgumentParser |
SimUseVideo | Sources/SimUseVideo/ | SimUseCore + AVFoundation/ImageIO |
iOSSimBackend | Sources/iOSSimBackend/ | SimUseCore + SimUseVideo + FB* XCFrameworks + AVFoundation |
AndroidBackend | Sources/AndroidBackend/ | SimUseCore + SimUseVideo + ArgumentParser |
SimUse (executable) | Sources/SimUse/ | SimUseCore + SimUseVideo + iOSSimBackend + AndroidBackend + FB* |
SimUseVideo holds the platform-neutral host-side video plumbing (H.264 Annex B parsing, passthrough muxing, AVAssetWriter encoding, frame utilities) shared by the iOS and Android recording/streaming paths. It must stay FB*-free — anything that needs FBSimulatorControl belongs in iOSSimBackend (e.g. the VideoFrameUtilities.captureScreenshotData extension), anything adb-shaped in AndroidBackend.
Verb dispatch
A verb (tap, swipe, type, ...) reaches three surfaces:
- Top-level —
Sources/SimUse/Commands/<Verb>.swift. Resolves the target viaPlatformRouter, then forwards to the iOS or Android backend. sim-use ios <verb>—Sources/iOSSimBackend/Verbs/IOSSim<Verb>Command.swift.sim-use android <verb>—Sources/AndroidBackend/Verbs/Android<Verb>Command.swift.
Four verbs are iOS-only (key, key-combo, key-sequence, batch) — no top-level alias.
Adding a new verb
- Cross-platform: write
IOSSim<Verb>Command+Android<Verb>Command, plus a top-level forwarder inSources/SimUse/Commands/<Verb>.swift. Register inIOSSimCommand.swift,AndroidCommand.swift, andmain.swift. - iOS-only: write
IOSSim<Verb>Command, register inIOSSimCommandonly. UseHIDKeyCommandHelp.androidUnsupportedMessageto reject Android UDIDs (seeIOSSimKeyCommand). - Shared flags:
@OptionGroup var udid: UDIDOptions+@OptionGroup var json: JSONOutputOptions.
Daemon
SimUseExecutableCommand.run() forwards UDID-scoped verbs to a per-UDID auto-spawned daemon (Sources/SimUseCore/Daemon/). Platform-agnostic — both iOS and Android verbs route through it. Key regression test: Tests/DaemonCommandParserInjectionTests.swift.
Android development
The bridge/ directory contains a Kotlin Android app (AccessibilityService + HTTP server) that the Swift CLI talks to over adb forward.
Required tooling
| Tool | Version |
| Android SDK | compileSdk=35, minSdk=30 |
| JDK | 17 -- 21 (Gradle 8.7 rejects 22+) |
| Gradle | 8.7 (wrapper in bridge/gradlew) |
scripts/build-bridge.sh auto-detects JDK and SDK paths. Run scripts/build-bridge.sh --check to verify the environment.
Bridge wire spec
BuildConfig.PROTOCOL_VERSION(Kotlin) andBridgeClient.expectedProtocolVersion(Swift) must match — bump together on breaking wire changes only.versionCode/versionNameinbridge/app/build.gradle.kts— bump on any APK change.- Endpoints:
bridge/.../server/ActionRouter.kt; handlers in.../handler/.
Bundling the APK
The APK is gitignored (Sources/AndroidBackend/Resources/*.apk). Run scripts/build-bridge.sh before make build so the binary includes Android support.
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
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.

