Repository navigation
Description
Purpose
Find out whether agent-device can drive watchOS simulators with the existing XCUITest runner design. The result is a go or no-go, plus a scoped follow-up issue. This is a spike. Do not ship a watchOS platform from it.
Today watchOS is an explicit unsupported sentinel. The interactor, gesture admission and the supported-deployment check reject appleOs: 'watchos', and discovery never produces it (#977, packages/platform-apple/src/__tests__/interactor-watchos-sentinel.test.ts). ADR 0009 records the reason as "XCUITest cannot drive watchOS UI" (docs/adr/0009-apple-platform-consolidation.md:29).
That reason looks outdated. The Xcode 27.1 watchOS simulator SDK ships XCUIAutomation.framework with XCUIApplication, XCUIElement, XCUIDevice and accessibility audits. It also has watch-specific APIs: performHandGesture: (watchOS 10+), a flick hand gesture (watchOS 12+), hasHardwareButton: (watchOS 9+), and openURL: and location (watchOS 9.4+). The runner's own xcodebuild output already lists "watchOS Simulator" as a destination.
Scope
Simulators only. Remote access needs no new transport. It goes through the existing paths: a Simlock-leased watch simulator (ADR 0021) on the ordinary local runtime, and/or agent-device proxy (Remote proxy) from another machine. Physical watches are out of scope, because a watch reaches the Mac through its paired iPhone, so the runner's direct HTTP connection may not apply.
Questions the spike must answer
- Can a watchOS UI-test bundle in the runner project build and run on a watchOS simulator with
xcodebuild test-without-building? - Can the runner drive an app other than its own host by bundle ID (
XCUIApplication(bundleIdentifier:)), as the iOS runner does? - Can the runner's in-test command server accept connections from the host daemon on a watchOS simulator, with the same transport as iOS simulators?
- Which existing runner commands work unchanged? List snapshot (tree shape, frames, hittability), tap on an element and on a coordinate, swipe and scroll, text input, Digital Crown (hardware button or rotation), hand gestures, screenshot and app lifecycle (
simctlinstall, launch, terminate). Note which commands must stay refused, as tvOS refuses coordinate gestures. - Does discovery, boot, install and screenshot through
simctlwork for watch simulators with the current Apple tool provider and simulator-set scoping? - Does a Simlock lease or
agent-device proxyneed any change to carry a watch simulator? Expect none. Say so if that holds.
Completion conditions
- A spike branch (not merged) with the minimal watchOS runner target and host wiring needed to answer the questions. Commands, simulator model, watchOS runtime, Xcode version and raw output are recorded for each question.
- A runnable demo on a watchOS simulator: open an app by bundle ID, take a snapshot, tap a named element, then take a screenshot, all through the branch-built CLI.
- A comment here that starts with
Decision: watchOS simulators:. It gives go or no-go with the evidence and the command matrix (works, needs work, must stay refused). - On go, a follow-up implementation issue that lists the runner target, discovery, interactor admission and the refused-command cells. It also amends ADR 0009's watchOS reasoning. On no-go, the decision comment names the blocking limitation, and ADR 0009 is updated with the verified reason.
Notes
- The host needs a watchOS simulator runtime. Download it with
xcodebuild -downloadPlatform watchOS, which is several GB. - Keep the spike's edits isolated from the iOS runner build. Do not change iOS runner behavior or caches.
- Follow
docs/agents/device-verification.md: verify with the branch-built CLI and close every session and simulator you start.
Activity
apex-sentinel-staging commentedon Nov 19, 2026
Apex Sentinel · Issue review
Suggested label:
featureThe issue defines a scoped spike to investigate whether watchOS simulators can be supported, with specific scope, questions, completion conditions, and a go/no-go deliverable. It is not merely asking how to do something; it requests maintainer investigation work toward possible new behavior.
thymikee commentedon Nov 19, 2026
Decision: watchOS simulators: go.
The XCUITest runner drives watchOS simulators. Its existing source set builds and runs on watchOS with small
os(watchOS)guards. ADR 0009's reason, "XCUITest cannot drive watchOS UI", is outdated. Follow-up implementation issue: #4738.Spike branch (not for merge):
t3/watchos-simulator-support(d96e340). Evidence, commands, and raw output are inapple/runner/AgentDeviceRunnerWatch/SPIKE.md.Environment: Xcode 27.1 (27A9275), watchOS 27.0 simulator (24R362). Simulators: Apple Watch Series 11 46mm, SE 3 40mm, and Series 11 42mm in a private simulator set.
Answers
AgentDeviceRunnerUITests/sources. The first build failed in two files only:XCUIDevice.orientationandAVAssetWriterare unavailable on watchOS. All Objective-C bridges compiled unchanged.xcodebuild test-without-buildingstarted the runner and printedAGENT_DEVICE_RUNNER_LISTENER_READYandAGENT_DEVICE_RUNNER_PORT=47911.XCUIApplication(bundleIdentifier: "com.apple.NanoSettings")launched and drove Settings.POST 127.0.0.1:<port>/command, the same as on iOS simulators.--ios-simulator-device-set), boot (32 s), install (4 s), open, simctl screenshot, andclose --shutdownall work. One gap: the managed runner build usesAgentDeviceRunner.xcodeproj, and xcodebuild rejects watchOS destinations for it. The spike used--ios-xctestrun-file.--ios-simulator-device-set, and it works for a watch: discovery, boot,test-without-building -DVTSimulatorSetLocation, snapshot, and press succeeded in a private set.agent-device proxyhas no Apple OS branch. The proxy was not exercised.Demo (branch-built CLI, Series 11 46mm)
Command matrix
type/fill: type into the system input sheet, then commit with Done (spike typedhello)gesture(pinch, rotate)keyboardStatus(reports hidden while the sheet is up)recordStart(no AVAssetWriter; use simctl recording)back(press the nav-bar Back button; today it hits the visionOS refusal)scroll(frame resolution is iOS-only today)--platform iosCleanup: I closed every session, shut down the simulators I booted, deleted both spike simulators and the private set, and removed the stray
watchos-simulatorderived cache.spike(watchos): gesture research — swipes, pan, crown, system surfaces (
thymikee commentedon Nov 21, 2026
Closing: the spike is done. The go decision is recorded above, and the feature landed under #4738.