Drivers
Every platform implements PlatformDriver (crates/atalanta-common/src/traits.rs), and the executor talks only to that trait. Its methods fall into these groups:
- Lifecycle:
prepare,cleanup,health_check,restart_session. - Devices:
list_devices,boot_device,shutdown_device. - Apps: install (by hash), launch (optionally clearing state), stop, reset, save and restore state, liveness and crash reports.
- Tree: find elements, the hierarchy (with a cache the executor invalidates after actions), visibility and text.
- Input: tap, double tap, long press, text, swipe and scroll, keys,
tapXY,inputRaw. - Screen: screenshots, screen size, system bars, status-bar freeze.
- Sync: settle on the device, the in-app probe port, network-busy.
- Web-only: navigation, back, refresh, mocks. These are errors on other drivers.
Every driver is wrapped in ResilientDriver (resilience.rs). It adds retries for transient errors and a circuit breaker per device.
Verification status#
Most verification is on emulators, simulators and headless Chrome. Two real devices have been used, each for a narrow set of checks. What has been run, and where:
| Platform | Run against | Not run |
|---|---|---|
| Android | Android emulators (API 33 and 34); one SUNMI tablet (Android 14), the Settings app only (2026-11-08 and 2026-11-21); the host tests use a fake adb | Any other real device; any app other than Settings on hardware |
| iOS | iOS 26 simulators, Xcode 26.0.1 (2026-10-25); one wired iPhone 12, iOS 26.5.2 (2026-11-21 and 2026-11-22: Settings, the launchApp arguments test app and the trust gates); the host tests use fake WDA, devicectl and usbmuxd |
On a real device: the Wi-Fi runner, the crash watcher, AtalantaRunner and ios.verifyTap. Any iPad |
| Web | Real headless Chrome on macOS, and on Linux in CI | Any browser other than Chrome or Chromium |
| Headless | flutter test on the host |
Anything on a device |
Items marked (unverified on devices) below have never run on hardware. See STATUS.md for the full list.
Choosing a driver#
Atalanta picks the platform from the first of these that is set:
--platformconfig.platform- The shape of
--device(Platform::of_device_id):- a simulator UUID or an iPhone UDID means iOS;
webmeans the web;- anything else (
emulator-5554, a USB serial,host:port/serial) means Android.
- iOS, when none of these gives one.
Two more settings pick the implementation. driver: device|headless (--driver) chooses a real or emulated target. framework: native|react_native|flutter (--framework) names the app's framework and is otherwise detected from the app build. The combinations are:
| driver | framework | Implementation |
|---|---|---|
| device | any | IosDriver, AndroidDriver, or WebDriver (Chrome) |
| headless | native | atalanta-headless (layout renderer) |
| headless | flutter | atalanta-flutter-bridge |
| headless | react_native | config error (RN_NO_HEADLESS, exit 2) |
| headless | any, on web | usage error |
React Native and Flutter on a device use the ordinary native driver. framework there changes only validation warnings.
Android (crates/atalanta-android)#
Supported: emulators and, in code, USB and remote devices. Only an emulator has been run. Needs adb on PATH (or ATALANTA_ADB_PATH).
- Transport:
adbfrom PATH, orATALANTA_ADB_PATH.ATALANTA_ADB_MODE=tcpspeaks the adb wire protocol directly. Installs and forwards still use the binary.ATALANTA_ADB_SERVERS=host:port,…adds remote adb servers. Their devices are namedhost:port/serial.
- Tree server:
- Atalanta's own on-device server is a small dex jar embedded in the binary (
assets/atalanta-tree.jar; source inprobes/android/atalanta-tree-server). - It is pushed to
/data/local/tmp, run withapp_process, and reached throughadb forward. - It keeps one UiAutomation connection and returns
uiautomator dump-format XML in milliseconds. - It also injects input, takes screenshots, lists windows and counts accessibility events.
- Fallback:
uiautomator dumpandadb shell input/screencap, with backoff.android.treeServer: 0forces the fallback. - The server holds the device's only UiAutomation slot. Another automation tool on the same device conflicts with it.
- Authentication (protocol 18). Every connection starts with a mutual HMAC handshake. The host sends
HELLO <nonce>. The server answersPROOF, an HMAC keyed with the token. Only then does the host sendAUTHwith its own HMAC, so the token itself never crosses the socket. - Token. It is new each time the server starts. It is left in
/data/local/tmp/atalanta-tree.token, readable by shell (or root) only, and the host reads it through adb. - Old or impostor servers. The host refuses servers older than 18: it asks them to
QUITand waits for them to go. A server that can't prove the token is reported as an app squatting on@atalanta_tree. - Stray clients. The first line that isn't a command closes the connection. An example is the HTTP request line from a browser's blind POST to the forwarded port. See SECURITY.md.
- Window handling (protocol 19).
WINDOWSnames the active window, so the tap guard counts another app's window in front (freeform or desktop windowing) as a cover. Popups are dumped only from the active app's own windows (or the framework's). Windows and rotation come from the active window's display (API 30+). A request id carries the host's wait (#<id>@<ms>), so a resend never parks a server thread longer than the host waits. The host keeps a session in place while it reconnects or resends, and removes anadb forwardits cancelled caller left. (Unverified on a device.) - Video server. The same jar carries
com.atalanta.tree.VideoServer, started as its ownapp_process, like scrcpy's server. Protocol 12 addedENCODERS, which lists the device's H.264 encoders. (Unverified on a device.)- A virtual display (Android 14+; SurfaceControl before) mirrors the screen into a MediaCodec H.264 encoder: 720p long edge, 2 Mbit/s, 30 fps at most, a key frame a second.
- The stream uses scrcpy's 12-byte packet header, over its own
adb forward. - It starts with a mutual HMAC handshake over a per-start token that the server leaves in
/data/local/tmp/<socket>.token(SECURITY.md). - The host keeps the last
artifacts.videoSecondsin memory and muxes a failed test's clip to MP4 itself (mp4.rs).AndroidDriver::video_streamexposes the live stream (video.rs). - If the encoder can't be used,
adb shell screenrecordrecords each test instead. See CLI.md.
- Atalanta's own on-device server is a small dex jar embedded in the binary (
- Logs: per test,
logcat -v threadtime -T <device time>(logcat.rs): the whole log and the app's pids plus the crash buffer; the app's crashes, native crashes and ANRs go into the failure message. - Compose:
id:also matches a ComposetestTag, read through accessibility extra data. Turn it off withandroid.composeTestTag: 0. (Unverified on devices.) - Input:
- Text goes in as
ACTION_SET_TEXTor as key events (android.text). - Inputs check focus before typing (
android.focusCheck). android.scroll: semanticuses the list's own scroll action.
- Text goes in as
- Launch arguments (
launchApp: arguments:, see DSL.md): intent extras onam start(--estext,--eztrue/false,--eior--elwhole numbers,--efdecimals). A launch whose launcher activity can't be resolved would fall back tomonkey, which can't carry extras, so it is a configuration error instead. - Animations: turned off on the first launch and restored afterwards, even if Atalanta is killed.
android.keepAnimations: 1leaves them on. - Status bar:
screenshots.freezeStatusBaruses SystemUI demo mode. (Unverified on devices.) - saveState:
run-as … tar, so it needs a debuggable build. Otherwise it uses an emulator snapshot. - Builds:
.apk, or a directory of split APKs (install-multiple)..aaband.apksare refused, with bundletool instructions.- Installs are skipped when the device already has the same build (a hash marker on the device).
- Emulators:
atalanta devices up --android Nstarts N read-only instances of one AVD.
iOS (crates/atalanta-ios)#
Supported: simulators, which carry most of the verification, and real iPhones and iPads. One wired iPhone 12 has been run; iPads and the Wi-Fi runner have not. Needs macOS, Xcode (xcrun, xcodebuild) and git for the WDA clone.
- Simulators:
xcrun simctl.atalanta devices up --ios Nclones a golden simulator. - Automation: WebDriverAgent over HTTP.
- On first use Atalanta clones WDA at a pinned tag, builds it once per Xcode under
~/.atalanta/wda, and runs one per simulator. - Pinned commits: v16.14.1 (where the simulator platform ships
lib_TestingInterop.dylib) and v16.12.10 (otherwise). A clone of a pinned tag must be at the commit Atalanta pins: a fresh clone at another commit stops the bootstrap, a cached clone at another commit is cloned again, and a cached build is reused only when it records the pinned commit (atalanta-wda-refnext to the build).ATALANTA_WDA_REFpicks another tag, unchecked. - Listening address. On a simulator (which shares the Mac's network) WDA's HTTP server is bound to
127.0.0.1(USE_IP). Its MJPEG screen stream (MJPEG_SERVER_PORT, WDA's port + 1100; the console's iOS mirror) ignoresUSE_IPupstream and has no authentication, so Atalanta patchesFBWebServer.min its clone to give the stream the same interface before building (mjpeg-use-ipinatalanta-wda-ref; a build from before the patch is rebuilt once). A WDA you start yourself, or one launched by an older Atalanta and kept withATALANTA_KEEP_WDA, still serves it on every interface. On a cabled iPhone both bind the phone's loopback, which the usbmux forward reaches;ATALANTA_IOS_DEVICE_LOOPBACK=0binds every interface instead (WDA then has no authentication: Atalanta warns). Before 2026-10-25 binding every interface was the default. ATALANTA_WDA_URLuses a WDA you run yourself.ATALANTA_KEEP_WDA=1leaves it running between runs; the launching run records which build it ran, so a later run that reattaches knows its ref.- One runner per simulator and port. A kept runner is adopted only by a run that asks for the same runner kind and build (and, for AtalantaRunner, has its token). Any other run stops it first (
simctl terminate), whatever its kind, and launches its own. Before launching, Atalanta checks that nothing listens on the port: a runner of the same simulator is stopped; another process is named in a device error (exit 3), never killed. A runner that fails to come up 3 times within 2 minutes is not launched again, and the step fails with a device error naming the last failure, instead of a relaunch every few seconds (a WDA that can't bind its port aborts at once). A run takes the device's lease before it prepares the driver, so it never touches a runner on a device another Atalanta process holds. - Session settings, sent after each session starts:
snapshotMaxDepth(ios.snapshotMaxDepth, default 60) andaccessibilityDeadline(ios.accessibilityDeadlineMs). Past the deadline WDA aborts the request with an error. The 5000 ms default goes only to a device whose WDA Atalanta built from v16.14.1 or later; an older or externally started WDA gets no deadline unless the setting is set. - The v16.14.1 tag for newer Xcode 26.x releases is unverified. The older tag was checked on Xcode 26.0.1.
- On first use Atalanta clones WDA at a pinned tag, builds it once per Xcode under
- AtalantaRunner (
ios.runner: atalanta/ATALANTA_IOS_RUNNER=atalanta):- Atalanta's own XCUITest runner (
probes/ios/AtalantaRunner). It serves the subset of WDA's HTTP API Atalanta uses and builds much faster than WDA. - Built with
xcodebuildand run on iOS 26 simulators (Xcode 26.0.1, 2026-10-25): a cold build took 25 s against WDA's 47 s. Unverified on real iPhones. - Every request needs the bearer token Atalanta makes per launch (
ios.runnerTokenreplaces it), a loopbackHostwith the runner's port, and noOriginor cross-siteSec-Fetch-Site(SECURITY.md). The runner doesn't start without a token, so one you launch yourself forATALANTA_WDA_URLneedsATALANTA_RUNNER_TOKEN, and Atalanta needs the same value inios.runnerToken.
- Atalanta's own XCUITest runner (
- Real iPhones and iPads (unverified on devices):
xcrun devicectlinstalls, launches and copies crash logs.- The runner's port is forwarded over an in-process usbmuxd connection (what
iproxydoes). - A runner that can't start says why and stops at once (exit 3): UI Automation not enabled (Settings → Developer → Enable UI Automation, phone unlocked), Developer Mode off, an untrusted signing certificate, or a locked device. A runner that logged "Running tests..." but isn't serving 20 s later gets a warning naming UI Automation.
- Signing needs
ATALANTA_IOS_TEAM_ID.atalanta signinguses an App Store Connect API key instead of an Apple ID. - A Wi-Fi-only device needs
ios.allowWifiRunnerand AtalantaRunner (whose token is always on). - These are simulator-only:
saveState/restoreState,clearState(a device warns; usereset: { strategy: reinstall }), and the status-bar freeze.
- Taps: a tap guard avoids taps on the keyboard and status bar (
ATALANTA_IOS_TAP_GUARD,ios.tapGuardStatusBar).- A target in a list that a bottom bar covers (a toolbar or tab bar, such as iOS 26 Settings' floating search bar) gets its list dragged up once, slowly from the middle of the list, and the tap runs again. Outside a scrolling list it is refused as before.
- A target behind a sheet, popover, in-app alert or the
PopoverDismissRegiondimming view is refused. While such a layer is up, the step's lookup tree is read once more with WebDriverAgent'svisible(the plain read leaves it out: it costs ~10x), so what XCTest reports hidden behind the sheet no longer matchesassertVisibleor a bare selector. The settle's polls never pay for it;ATALANTA_IOS_SHEET_VISIBILITY=offturns it off; AtalantaRunner is not asked (itsvisibleis frame-only). (Unverified on a simulator.) - A switch that spans its row (a SwiftUI
Togglewith its label) is tapped at its trailing end, where the knob is. When its value hasn't changed 0.6 s later (the row is mirrored, RTL), its leading end is tapped once. (Unverified on a simulator.)
- Launch arguments (
launchApp: arguments:): passed as-name valuetosimctl launch,devicectland WebDriverAgent, booleans asYES/NO, so the app reads them withUserDefaultsas Xcode scheme arguments. - Typing:
ios.text: auto|paste|keys. A secret (a registered--secretor secret-named value) or a secure field is always typed as keys, never put on the simulator's pasteboard, which macOS shares with the Mac. - WebDriverAgent ref: a ref other than Atalanta's pinned tags (
ios.wdaRef/ATALANTA_WDA_REF, which a suite'sconfig.settingscan set) builds with a warning: its commit is not checked. ios.verifyTap(opt-in; AtalantaRunner only) (run on an iOS 26 simulator; unverified on real iPhones):- Before each tap the runner asks XCTest's private hit test (
_XCT_requestElementAtPoint:reply:, every selector checked withrespondsToSelector:) what is at the point, and finds that element in the app's snapshot by its accessibility element. It sends the element's type, identifier, label, frame, snapshot path and chain from the root. - The host places it in its tree by that path: the target or something inside it passes; anything else is drawn over the target and the tap fails, naming it. When XCTest's element is a container of the target, or can't be placed, the deepest node at the point decides, skipping only nodes the snapshot reports with user interaction off (not being an accessibility element or not "hittable" to XCTest does not count: a plain
UIViewdimming overlay is both and still swallows the touch). - A point owned by SpringBoard (status bar, system alert) or another process fails, except inside a web view, whose page WebKit's WebContent process draws. When the deepest node decides and it is the bare root of another, empty window (SwiftUI keeps one after the content window on iOS 26), it is looked through. WebDriverAgent has no hit test: the frame rule alone applies, with one warning.
- Each verified tap costs one app snapshot.
- Before each tap the runner asks XCTest's private hit test (
- Crash watcher (unverified on hardware): on a real iPhone, the app's state is polled every second after launch, on its own short-timeout connection, reading the session without waiting for the device's request lock (a slow
/sourceread does not delay it); a crash makes later steps fail at once (see "Sticky crash" in ARCHITECTURE.md).restoreStateandlaunchAppstill run. - System alerts: handled unless
ios.systemAlerts: 0. - Failure evidence (simulators):
simctl io recordVideo --codec h264per test, stopped with SIGINT (which finalizes the file) and kept on failure;simctl spawn log stream --style compact --level infofor the app's process. Real devices have neither yet.
Web (crates/atalanta-web)#
Supported: Chrome or Chromium on macOS, headless by default. Needs Chrome or Chromium installed. Linux is untested.
- Browser: Chrome or Chromium only, over the DevTools protocol (
chromiumoxide).- Settings:
web.chromePath,headless(default true),width/height(default 1280×800). - A
BrowserProtocolseam exists for WebDriver BiDi, but no Firefox or Safari adapter is written.
- Settings:
- Tree: an injected script in an isolated world returns the DOM as
Elements, with computed ARIA roles and accessible names. - Input:
Input.dispatch*Event. With a touch profile, taps and swipes are touch events.- Typing: printable ASCII goes in as real key events (
keydown/keypress/keyup, so key listeners and search-as-you-type fire); other characters (a newline included, so it never presses Enter) and text longer than 256 characters go in withInput.insertText.ATALANTA_WEB_TYPING=insertinserts everything, the old behaviour. - Popups and new tabs a click opens are followed; when one closes, its opener is driven again.
- The hit-target check at click time blocks touch events too (
touchstart/touchmove/touchend), so an overlay's touch handlers don't run on a touch profile.
- Typing: printable ASCII goes in as real key events (
- Forms:
inputTexton a<select>(or its label) chooses the option whose value or label is the text. Atapon an<option>of a closed drop-down chooses it the same way.inputTexton an<input type=file>(or its label) gives it the files at the paths in the text, one per line, relative to the working directory (DOM.setFileInputFiles). A missing file is a config error; inputs inside cross-origin frames are not supported.
- Dialogs:
alert()andbeforeunloadare accepted.confirm()andprompt()are dismissed unlessweb.dialogs: accept(settingATALANTA_WEB_DIALOGS); an accepted prompt returnsweb.promptText. Dialogs in cross-origin frames are answered the same way. - Downloads: refused by default, with a warning naming the file.
web.downloads: <folder>(settingATALANTA_WEB_DOWNLOADS) saves them there. - TLS: Chrome refuses invalid certificates (chromiumoxide's default ignored them). For a self-signed dev server set
web.insecureCerts: 1(ATALANTA_WEB_INSECURE_CERTS=1). index:counts only rendered matches with part of their box in the viewport, in reading order (rows top to bottom, each left to right), forcss:,id:,className:and every other selector: the same countexploreused when it wrote the test.- Mobile web:
web.devicetakes any Playwright device descriptor name. It sets the viewport, DPR, user agent, mobile layout and touch. This is Chromium's responsive mode, not Safari. - Parallel:
--parallel Ncreatesweb-0…web-N-1.- The default
web.parallelMode: contextsuses browser contexts in one Chrome. processesstarts one Chrome per worker.
- The default
- Network:
- The settle waits for network idle (
web.networkIdle,web.networkIgnore). web.mocks,web.blockandmockRequestuse the Fetch domain.- Service workers are bypassed while mocks are active.
- The settle waits for network idle (
- Failure evidence: the CDP screencast (
Page.startScreencastJPEG frames, the lastvideoSeconds) written asscreencast.json+ frames, and console calls, page errors,Logentries and failed or 4xx/5xx requests (console.log). - Cross-origin iframes: reached over their own DevTools sessions (
web.frames). Relations such asbelow:and mocks don't reach inside them. - Verification: tested against real headless Chrome on macOS only. Linux is untested.
Headless (crates/atalanta-headless, crates/atalanta-flutter-bridge)#
Headless drivers run without a device. Native headless is an approximate renderer for smoke checks. Flutter headless runs your app's own widget tests, and you start the Dart side.
- Native headless:
- A CPU renderer (Taffy layout, tiny-skia paint) for Android layout XML (also read out of an APK) and iOS
.xib/.storyboard. It needs no emulator. - It is an approximate smoke renderer:
- taps do nothing;
inputTextappends;- images, shadows, transforms and custom fonts are not drawn (each gives one warning).
- Config:
headless.width/height/density/fontScale/appPath/initialLayout.
- A CPU renderer (Taffy layout, tiny-skia paint) for Android layout XML (also read out of an APK) and iOS
- Flutter headless:
- A JSON-lines TCP connection to a Dart process running
flutter testwith theatalanta_flutter_helperpackage (crates/atalanta-flutter-bridge/dart). You start the Dart side yourself. - It reads the semantics tree and needs Flutter 3.19 or newer.
- Tested with
flutter teston the host only.
- A JSON-lines TCP connection to a Dart process running
In-app sync probes#
Use a probe when polling the screen is not enough to tell that the app is idle. Probes are optional libraries for debug builds, and they tell Atalanta when the app is idle. See ARCHITECTURE.md#sync.
- iOS
probes/ios/AtalantaSyncProbe(SwiftPM):- Call
AtalantaSyncProbe.start(). It tracks run loop work, animations, URL requests, timers andperformSelector:afterDelay:work. - React Native: with
framework: react_nativeit also waits for JS timers (RCTTiming), Fabric mounts and RN loading. Checked against fake ObjC classes only, not a real RN app. - It uses port 19400 (
ATALANTA_SYNC_PORT). Real devices reach it over usbmux. - Host type-checked only.
- Call
- Android
probes/android/atalanta-sync-probe:- Call
AtalantaSyncProbe.start(this). It tracks the main looper, animations and delayed main-looper messages due within the horizon (1.5 s orsync.maxTimerMs;ignoreTimerCallbacksexcludes the app's own pollers). - Network: add
AtalantaOkHttpInterceptorto the app's OkHttp client, or report requests yourself. - React Native: with
framework: react_nativeit also waits for JS timers, RN network calls, native animations and Fabric mounts. Host-checked with fakes only. - It uses port 19401 through
adb forward. - Both probes speak protocol 4 (
frameworkinconfigand the reply, plusunknown). - The Kotlin source has not been compiled in a development run, and nothing here has run on a device.
- Call