Files
callstack__agent-device/ios-runner
Si Huynh d2a3742c7c fix: enable tvOS compilation for XCUITest runner (#492)
* fix: enable tvOS compilation for XCUITest runner

XCUICoordinate type and XCUIElement.tap() are unavailable on tvOS.
Gate coordinate-based interactions and touch APIs behind #if !os(tvOS)
and provide tvOS alternatives using XCUIRemote (Siri Remote) actions:

- tap/doubleTap → XCUIRemote.shared.press(.select)
- longPress → XCUIRemote.shared.press(.select, forDuration:)
- drag → directional remote press based on primary axis
- back gesture → XCUIRemote menu button
- app switcher → double home press
- pinch/rotate → return unsupported (no-op / false)
- keyboard dismiss → remote menu button
- alert accept/dismiss → remote select button

Verified: builds successfully for both tvOS Simulator and iOS Simulator.

* fix: harden tvOS runner interactions

* refactor: prune tvOS remote helpers

* test: keep fallow focused on tvOS changes

---------

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2026-05-12 10:32:21 +02:00
..

agent-device iOS Runner

This folder contains the lightweight XCUITest runner used to provide element-level automation for Apple-family targets.

Intent

  • Provide a minimal XCTest target that exposes UI automation over a small HTTP server.
  • Allow local builds via xcodebuild and caching for faster subsequent runs.
  • Support simulator prebuilds where compatible.

Status

Current internal runner for iOS, tvOS, and macOS desktop automation.

Protocol and maintenance references:

UITest Runner File Map

AgentDeviceRunnerUITests/RunnerTests is split into focused files to reduce context size for contributors and LLM agents.

  • RunnerTests.swift: shared state/constants, setUp(), and testCommand() entry flow.
  • RunnerTests+Models.swift: wire protocol models (Command, Response, snapshot payload models).
  • RunnerTests+Environment.swift: environment and CLI argument helpers (RunnerEnv).
  • RunnerTests+Transport.swift: TCP request handling and HTTP parsing/encoding.
  • RunnerTests+CommandExecution.swift: command dispatch (execute*) and command switch.
  • RunnerTests+Lifecycle.swift: activation/retry/stabilization and recording lifecycle helpers.
  • RunnerTests+Interaction.swift: tap/drag/swipe/type/back/home/rotate/app-switcher helpers.
  • RunnerTests+Snapshot.swift: fast/raw snapshot builders and include/filter helpers.
  • RunnerTests+SystemModal.swift: SpringBoard/system modal detection and modal snapshot shaping.
  • RunnerTests+ScreenRecorder.swift: nested ScreenRecorder implementation.

Protocol Notes

  • The daemon posts JSON commands to POST /command on the runner's local HTTP listener.
  • The runner responds with a JSON envelope shaped as { ok, data?, error? }.
  • The protocol is internal to agent-device; when adding or renaming commands, update both wire models and the protocol tests/docs in the same change.