AXe is a command-line tool that automates iOS simulators, including the dual-screen iPhone Duo, and connected iPhones and iPads. It reads the accessibility tree, sends taps, typing, gestures and hardware buttons, captures screenshots and video, and changes device settings. An agent mode gives AI agents checked, stateful control of the UI, and axe remote puts this Mac's simulators on your iPhone or iPad, live and touchable, with your builds to install.
brew install cameroncooke/axe/axe
axe --helpaxe init installs the skill bundled with your AXe binary for the AI clients it detects (--client claude|agents, --dest <dir>, --force, --uninstall, --print). To keep the skill updated as releases ship, install it from this repository's marketplace instead, and keep the CLI on the latest release:
claude plugin marketplace add cameroncooke/AXe --sparse .claude-plugin agent-plugin && claude plugin install axe@axe
codex plugin marketplace add cameroncooke/AXe --sparse .agents --sparse agent-plugin && codex plugin add axe@axeThe plugin is the agent-plugin folder: its manifests and the skill in agent-plugin/skills/axe. --sparse fetches only the marketplace files and that folder, not the rest of the repository.
axe list-simulators # find a booted simulator's UDID
export UDID=<UDID>
axe describe-ui --udid "$UDID" # accessibility tree as JSON
axe tap --label "Continue" --udid "$UDID"
axe type 'Hello world' --udid "$UDID"
axe screenshot --udid "$UDID" --output screen.pngEvery command needs an explicit --udid; AXe never picks a device for you. Coordinates are logical points in the current orientation, the units axe displays reports, not screenshot pixels. Run axe <command> --help for every option.
Without --output, commands print text:
- Commands that read or change state print that state in a few lines (
displays,settings,hinge,rotate,doctor,shutdown,clipboard copy). - Input commands print nothing on success, except
tap,sliderandbatch, which print a✓ … completed successfullyline. screenshotandrecord-videoprint the file path.- A failure prints
Error: <message>to stderr and exits nonzero.
Put --output json before the command for one axe.output.command-result object on stdout:
$ axe --output json screenshot --udid "$UDID" --output shot.png
{"command":"screenshot","data":{"result":{"path":"/…/shot.png","pixelHeight":2868,"pixelWidth":1320}},"didError":false,"nextSteps":[],"schema":"axe.output.command-result","schemaVersion":"1"}
$ axe --output json tap --id no-such-element --udid "$UDID"
{"command":"tap","data":{},"didError":true,"error":{"code":"elementNotFound","message":"No accessibility element matched --id 'no-such-element'. …"},"nextSteps":[],"schema":"axe.output.command-result","schemaVersion":"1"}
command is the full command path, such as settings status-bar set. data.result is the command's typed result. error is present exactly when didError is true. Input commands return {outcome: "completed"}; media commands return {path, pixelWidth, pixelHeight, frames?}. Branch on error.code, not on messages or nextSteps, whose wording can change. A failure never repeats input. After screenshot and record-video, --output is still the file path; stream-video refuses an output format. SIGINT or SIGTERM exits with 128 + the signal.
--verbose prints the full receipt (context reads, target checks, cleanup evidence) where AXe owns the input or capture. It only adds detail: the exit status and the error code are the same with and without it.
Simulators and physical devices share one error vocabulary. The codes that matter most:
| Code | Meaning |
|---|---|
invalidArguments |
Options or values are wrong, including characters type cannot send; nothing was sent |
targetNotFound, notBooted |
No simulator or device has the UDID, or the simulator is shut down |
busy, timeout, interrupted |
Another AXe command holds the device, a deadline passed, or a signal stopped the command |
elementNotFound, ambiguousElement, elementNotHittable |
A selector matched nothing, several elements, or an element without a usable frame |
rejectedBeforeInput, inputFailed, inputUnavailable |
Input was refused before sending, stopped after some input, or AXe could not reach the input service |
cleanupUncertain, quarantined |
A touch or key may still be held; input stays blocked until you check the device |
screenChanged, screensDidNotSettle, bootChanged |
The screen or boot changed under the command |
captureFailed, outputFailed, readFailed, xcodeUnavailable |
Capture, output file, a state read, or the selected Xcode failed |
actionOutcomeUnknown |
A shutdown or clipboard copy may have happened but could not be confirmed |
unsupportedOnDevice, settingUnsupported |
The target does not offer this command or setting |
unsupportedInDeviceSet |
The command works in the default device set only and AXE_DEVICE_SET_PATH selects another |
unsupportedDevice |
The simulator has no built-in touch display, as on Apple TV; AXe supports iPhone and iPad simulators |
commandFailed |
Anything else |
Feature-specific codes are listed in their sections. JSON Schema (2020-12) files are in schemas/: the command result envelope, each command's data.result (in $defs, keyed by the full command path), and the agent result version 1 (--view full) and version 2. Receipts printed by --verbose are not described. Ignore fields you do not know; AXe can add them within a schema version.
axe describe-ui --udid "$UDID" # the whole tree as JSON
axe describe-ui --point 200,400 --udid "$UDID" # the element at one point
axe describe-ui --minimal-keys --udid "$UDID" # fewer fields, faster--minimal-keys reads only each element's label, identifier, value, frame, role, role description, type and enabled state (plus an empty traits list), which made a read of the Settings screen about 30 ms faster. For agents, describe-ui --agent returns compact rows with refs instead; see Agent mode.
axe tap -x 200 -y 400 --udid "$UDID"
axe tap --id SaveButton --element-type Button --udid "$UDID"
axe tap --label "Done" --wait-timeout 5 --udid "$UDID" # poll until it appears
axe tap --label "Photo" --hold 1 --udid "$UDID" # long press an element
axe tap --id Map --count 2 --udid "$UDID" # double tap
axe tap --id Canvas --touches 2 --udid "$UDID" # two-finger tap
axe type 'Hello' --udid "$UDID"
printf 'line one\nline two' | axe type --stdin --udid "$UDID"
axe type 'Grüße an @alle' --udid "$UDID" # typed on the simulator's keyboard layout
axe key 40 --udid "$UDID" # Return
axe key-sequence --keycodes 42,42 --udid "$UDID" # two Backspaces
axe key-combo --modifiers 227 --key 4 --udid "$UDID" # Cmd+A
axe button home --udid "$UDID"
axe touch -x 100 -y 200 --down --up --delay 1.0 --udid "$UDID" # long press
axe slider --id volume --value 75 --udid "$UDID"tap selectors are --id, --label or --value, optionally narrowed with --element-type. On a point or an element, --hold <seconds> makes a long press, --count 2 a double tap and --touches 2 a two-finger tap (two contacts 40 points apart); these three send real touches and need plain input, without --agent or --input-mode selected. --tap-style chooses automatic (the default: a touch for switches, a simulator tap otherwise), simulator or physical. type picks its keys from the simulator's own hardware keyboard layout, read from the simulator's keyboard settings, so text arrives as written on German, French, British and other keyboards, including characters that need Option or a dead key (@ and é on German). A character the layout has no key for, such as 日, fails with invalidArguments before anything is typed. --layout <name> names a layout the runtime ships (German, French, Dvorak); --layout us sends US key positions whatever the simulator is set to, which is what type always did before. An app keeps the layout it first typed with: after changing the simulator's keyboards, relaunch the app or pass --layout. With a keyboard that has no Latin letters, such as Russian, iOS types US positions in fields that take only ASCII (email, URL, password), so text only the US table can type is sent that way; pass --layout us for other text in those fields. A physical device decodes keys with its own layout too, but it does not report which keyboard is in use, so --layout auto is refused there: AXe sends US key positions unless you name the device's layout, for example --layout British on a UK iPhone, using the layout data of the installed simulator runtime closest to the device's iOS version. Keys take HID usage codes. Buttons are home, lock, side-button, siri and apple-pay.
axe swipe --start-x 200 --start-y 600 --end-x 200 --end-y 300 --udid "$UDID"
axe gesture scroll-up --udid "$UDID"
axe gesture scroll-down --distance 0.6 --udid "$UDID" # 60% of the screen height
axe gesture scroll-up --until-label "Privacy" --udid "$UDID" # scroll until it is on screen
axe gesture scroll-left --inside-id Toolbar --until-label "Share" --udid "$UDID" # inside one strip
axe gesture swipe-from-top-right-corner --udid "$UDID" # Control Centre
axe drag --start-x 200 --start-y 300 --end-x 200 --end-y 500 --hold 0.6 --udid "$UDID" # reorder a row
axe gesture pinch --scale 2 --udid "$UDID" # zoom in at the screen centre
axe gesture pinch -x 200 -y 400 --radius 60 --scale 0.5 --udid "$UDID" # zoom out
axe gesture rotate -x 200 -y 400 --radius 80 --degrees 90 --udid "$UDID"
axe draw 100,400 300,400 --udid "$UDID" # a line
axe draw 200,300 300,480 100,480 --close --duration 1.5 --udid "$UDID" # a trianglePresets are scroll-up|down|left|right, swipe-from-left|right|top|bottom-edge (--edge-inset moves the start of an edge swipe) and swipe-from-top-right-corner, which opens Control Centre. A scroll preset moves 200 points, or --distance as a fraction of the screen's height or width (0.05 to 0.95). With --until-id or --until-label a scroll preset, or a swipe between your own points, reads the screen, scrolls and reads again until that element is on screen, at most --max-swipes times (default 10, up to 50). An element counts as on screen when a lookup at its centre finds it, so one that sits past the edge of a strip or under another control does not. Each of these scrolls slows to a stop before the finger lifts, so the content moves the length of the scroll and no further; a plain scroll flicks it about as far again. It sends no input when the element is already there, and fails with elementNotFound when the limit is reached or as soon as a scroll moves nothing, which means the content is at its end. --inside-id or --inside-label lays a scroll preset out inside that element instead of the screen, for a list or strip that is only part of the screen (simulators). drag --hold <seconds> rests the finger on the start before it moves: about 0.6 starts a list reorder or lifts an icon. Presets act on the screen's size in points in the current orientation; --screen-width and --screen-height override it. Two routes do not measure the screen and assume 390×844 unless you pass both: a simulator without the DTUHID touch service, and a gesture step in a batch on a simulator other than the iPhone Duo. Coordinate gestures are pinch, double-tap, rotate, two-finger-tap, two-finger-hold and two-finger-swipe; they need no mode flag. pinch without -x/-y uses the centre of the active screen, and without --radius starts a quarter of the screen's shorter side from it, or closer so that the wider end stays 16 points inside the screen; --scale above 1 zooms in. On a simulator without the DTUHID touch service (Xcode 26), coordinate gestures send through the plain commands' Indigo input instead.
draw moves one finger down at the first of 2 to 1,000 x,y points, in straight lines through the rest, and up at the last; --close returns to the first point. The stroke takes --duration seconds (default 1, at most 30). A point outside the active screen fails with invalidArguments before input. drag is the two-point case with explicit move events.
None of these commands proves that the app recognised the gesture; read the screen afterwards.
axe batch --udid "$UDID" --step "tap --id BackButton" --step "type 'hello'"
axe batch --udid "$UDID" --file steps.txt # one step per lineSteps are tap, swipe, gesture, draw, touch, type, button, key, key-sequence and key-combo, plus sleep <seconds>. They run in order, back to back, in one input session: add a sleep step where the app needs time to catch up. A failure stops later steps, and earlier steps are not undone. On a simulator, --continue-on-error runs the remaining steps after a failed one; on the iPhone Duo it still stops after a context change or input failure. Success prints ✓ Batch completed successfully (N steps). Agent batches (batch --agent) take JSON instead; see the batch reference.
Every axe command starts a process, loads the simulator frameworks and finds the simulator before it does any work. A test harness that sends hundreds of commands can keep one process open instead:
axe serve --udid "$UDID"Write one command per line to its standard input, as you would type it after axe but without --udid. Each command gets one line on standard output: the JSON that axe --output json <command> prints, in order. serve prints a ready line first and exits when its standard input closes; logs go to standard error.
describe-ui --minimal-keys
tap --label General
ping
Commands are describe-ui, displays, screenshot, tap, swipe, drag, draw, type, button, key, key-sequence, key-combo, touch, gesture, slider, rotate and hinge; ping answers without touching the simulator. A failed or refused line gets its error reply and serve carries on. Each command takes the same route as the one-off command, so taps still go through the shared input broker, and other axe commands can use the simulator while serve runs. While serve waits for its next line it keeps a running broker from shutting down, so a tap after a long pause is as quick as any other. On an iPhone 17 Pro simulator with Settings open, reading the screen and then tapping took about 176 ms through serve, or 146 ms with describe-ui --minimal-keys, against about 290 ms with one-off commands.
axe screenshot --udid "$UDID" --output screen.png
axe record-video --udid "$UDID" --fps 15 --output recording.mp4 # Ctrl+C to stop
axe stream-video --udid "$UDID" --fps 10 --format mjpeg > stream.mjpeg
axe stream-video --udid "$UDID" --fps 30 --format ffmpeg | \
ffmpeg -f image2pipe -framerate 30 -i - -c:v libx264 -preset ultrafast output.mp4stream-video formats are mjpeg (multipart JPEG), raw (4-byte big-endian length, then a JPEG), ffmpeg (concatenated JPEGs) and bgra (packed pixels; a selected-screen stream prints its width and height on stderr, the ordinary simulator stream does not, so pass --screen-id and --screen-uuid when you need them). On a physical device --format h264 streams native H.264 Annex B. Stream bytes go to stdout and diagnostics to stderr; keep them separate. --fps is an upper limit. On any simulator, record-video --follow-active-display follows the active screen through folds and rotations into one fixed-size movie, and --screen-id with --screen-uuid captures one screen and fails if it stops being active; see the recording reference.
axe remote serves this Mac's simulators and builds to the free AXe Mirror app on iPhone and iPad. The app shows the simulator's screen live and sends your touches back to it. The app is open source: you can build it yourself from this repository without the App Store.
axe remote pair # show a one-time code and QR code for the app to scan or type
axe remote # host; choose, boot or create the simulator in the app
axe remote mirror --udid "$UDID" # host this booted simulator only; Ctrl+C to stop
axe remote devices # list the paired devices
axe remote unpair "Ada's iPhone" # remove one by name or IDremote pair prints a ten-character code (XXXXX-XXXXX) and the same code as a QR code in the terminal, then waits for the app to use it. The code works once and for ten minutes, and the host does not have to be running. --name sets the name the app shows for this Mac (the Mac's own name by default), and --json prints JSON lines instead of the QR code: one with the code, one when a viewer has paired. Only paired viewers can connect; any other is refused before any video or touch is exchanged. remote devices lists them by name, date paired and ID (--json for JSON), and remote unpair removes one by its name, its ID or the first six or more characters of its ID. iOS tells an app only that its device is called "iPhone" or "iPad", so a second device with a name already on the list is listed as "iPhone 2". Unpairing takes effect at once: a running host closes the session that viewer has open within a second and prints unpaired (viewer). The app looks for the Mac on every relay it could be on, so pairing does not depend on both sides picking the same one; a Mac on a relay named with --relay-url puts it in the QR code, and the code typed by hand will not find that Mac.
axe remote opens no simulator at first. The app opens the Mac on a menu, Simulators and Apps, and says whether it reaches the Mac directly or through a relay. Simulators lists this Mac's iPhone and iPad simulators, running ones first. The app is sent the list when it connects and after anything it changes itself; pull the list down to read it again, for a simulator booted, shut down or made on the Mac since. Tap one to open it; one that is shut down is booted first, which takes a few seconds, or about a minute for a simulator that has never run. "New simulator" creates one from a name, a device and an installed iOS version, then boots and opens it. The host prints the UDID of each simulator it creates or opens, and the app shows it and copies it with one tap, so you can paste it into an agent or a command: "use this simulator". Info, beside that button, says what the simulator on screen is: its name, its device, its iOS version with the build, its screen size and its ID, and how the Mac is reached. Close goes back to the list and asks whether to leave the simulator running or shut it down; the list's Close leaves the Mac. When the simulator on screen stops answering (its screens, its touches, a fold, or a process started in it), the host prints unresponsive (udid, reason) and the app says so with a Restart button, which shuts the simulator down, by force if it will not stop, then boots and opens it again; responsive follows when it answers again. Restart is also in each running simulator's menu in the list. The host never restarts a simulator by itself: that closes the apps in it, and an agent may be using it. The host also watches the Mac's own load: after ten seconds of overload it prints macBusy (load, cpu) and the app says that the simulator may lag, or, if it has stopped answering too, that it is slow to answer and may catch up; macNotBusy follows ten quiet seconds later. Each simulator in the list has a menu that shuts it down or deletes it; deleting asks first, and removes the simulator and everything in it from the Mac. A simulator left running stays booted when the viewer leaves and when the host stops. Anyone you paired can do all of this, deleting included, so start the host with --udid when a viewer should see one simulator and no more.
AXe also gets a build of your app onto the device in your hand. It builds or takes a signed IPA, checks it, and offers it in the AXe Mirror app with an Install button:
axe remote build --project App.xcodeproj --scheme App --notes "Fixes the login screen" # archive, export for Ad Hoc, publish
axe remote publish App.ipa --notes "Fixes the login screen" # an IPA you already have
axe remote builds # what is on offer; --remove, --keep, --notes and --clean manage itbuild archives the scheme with xcodebuild and exports it for Ad Hoc (Release Testing) distribution with the project's own signing (--team-id, --configuration, --export-options). With automatic signing Xcode uses the team's Ad Hoc profile for the app, which holds the devices registered with the developer account when the profile was made; --allow-provisioning-updates lets Xcode make it again, which is how a device registered since gets in. The Xcode archive and the logs, some hundreds of megabytes, are removed once the build is published; --keep-archive keeps them, for the debug symbols, and prints where; they stay until axe remote builds --clean removes them. A build that fails keeps them to be read, and the next build removes any older than three days. A build that is still running is never removed, by either. Every IPA is checked before it is offered: it must be a device app signed for Ad Hoc distribution, with profiles that have not expired and that match its bundle ID, team and signing certificate, and with --device <udid> that device must be in the profile. An IPA that iOS would refuse is refused here, with the reason. The result says how many devices the build is signed for and, by name, which of the devices this Mac knows it will and will not install on (devices_covered and devices_not_covered with --json, which prints the build as one object). An app cannot read its own device identifier, so the AXe Mirror app cannot say whether the device it is on is one of them: a build that is not signed for it is refused by iOS when it is installed.
A running axe remote host offers the builds in the store to its viewers. The app lists them on the Mac's menu when Apps is tapped. With builds of one app, the list is that app's builds, newest first. With builds of several, it has one row for each app however many builds it has: tap an app for its builds, or hold it down to install its latest build. A build opens on a screen of its own with Install, its notes in full and its details. A line at the foot of the screen says so when a build is published while you are connected, or when the Mac has a newer build of AXe Mirror itself. --notes is the build's release notes: the list shows the start of them and the build's own screen all of them, up to 4,000 characters. Pairing is all a build needs to reach the device: there is no other network, VPN or server in the way. An app cannot install another app: iOS downloads a build itself, only over HTTPS, and only from a name whose certificate the device trusts. So the build goes to the app over the paired connection, direct when it can be and through the relay when not, and the app serves it to iOS from the device itself, under a real name that resolves to 127.0.0.1 (iOS does not connect to localhost or 127.0.0.1 for this; measured on iOS 27.3). The host makes the certificate for that with the system's openssl, throws away the key that signed it, and sends it to the app. The authority you are asked to trust can vouch only for those three names: its certificate carries name constraints, the app checks them before it offers it, and iOS refuses anything else signed by it, so trusting it gives nobody a way to pass for another site. It can be removed in Settings › General › VPN & Device Management. The first time you tap Install, the app opens a setup for it: it opens the certificate in Safari and says where in Settings to install it and to switch it on (General › About › Certificate Trust Settings), once for each Mac. It checks by itself when you come back and offers the build you asked for; after that, Install is one tap. A short video of the taps plays on that screen and goes on playing in Picture in Picture while you are in Safari and Settings, so you can follow it there. The names are local.axe-cli.com, localtest.me and lvh.me; a network that refuses to resolve a public name to 127.0.0.1 cannot install builds this way, and the setup screen says so when that is what is wrong. A download that loses its connection carries on from where it stopped once the Mac is back.
The host prints buildsChanged (count, newest) when the builds change while a viewer is connected, and installRequested (bundleID, name, version, build) when a build has reached the device and been handed to iOS; it cannot tell whether iOS then installed it. Builds are kept in ~/Library/Application Support/AXe/mirror/builds; --builds <folder> or AXE_MIRROR_BUILDS uses another store, and --no-builds offers none. axe remote builds manages the store: --remove <id> removes a build by its ID or the start of it, and can be repeated; --keep <n> keeps the newest n of each app and removes the rest; --notes <id> "<text>" replaces a build's notes; --clean removes any archives and logs left behind, kept ones included; --json prints the builds, what was removed, and how much is left behind. Removing a build stops it being offered. It does not take it off a device that has installed it: nothing can, and it stops working there only when its signing profile expires. A build's app is never changed once published.
{"event":"ready","relay":"<relay URL>"}
{"event":"viewerConnected"}
{"event":"simulatorCreated","model":"iPhone 18 Pro","name":"Checkout test","os":"iOS 27.2","udid":"<UDID>"}
{"event":"simulatorSelected","name":"Checkout test","udid":"<UDID>"}
{"event":"streaming","height":"2296","width":"1056"}
{"event":"simulatorReleased","udid":"<UDID>"}
{"event":"simulatorShutDown","name":"Checkout test","udid":"<UDID>"}
{"event":"simulatorDeleted","name":"Checkout test","udid":"<UDID>"}
simulatorSelected is printed when the simulator is booted and about to be streamed, and simulatorReleased when the viewer goes back to the list. simulatorShutDown and simulatorDeleted are printed when the viewer has had the host do that, and simulatorRestarting when it has asked for a restart, before the simulator is booted and selected again. A viewer that only lost its connection carries on with the simulator it had. An app older than 1.2 cannot show the list: the host prints a warning with code viewerTooOld, and that viewer needs the app updated or a host started with --udid.
Any number of paired viewers can be connected at once, and none takes another's place. Each has its own session: its own simulator, its own picture and its own builds. An event that comes from a viewer also carries viewer, its ID as axe remote devices lists it, and viewerName, so the lines of two viewers can be told apart. Two viewers may open the same simulator, and all viewers of a --udid host have the one: each gets its picture and the touches of all of them reach it, and a viewer that shuts it down, deletes it or restarts it does so for the others too: they are told which, and sent back to the list.
axe remote mirror --udid <UDID> hosts that one simulator, which must be booted, and the app opens it at once.
An iPhone Duo simulator is streamed from whichever of its two screens is lit, the outer one closed and the inner one open, and touches go to that screen. The app shows it flat, as any simulator, and says how it is folded. Fold turns the live picture into a 3D Duo that you fold by dragging its halves, from any iPhone or iPad: it opens like a book held in both hands, and closed it shows its outer screen. While you fold, touches move the Duo, not the simulator, and the simulator's hinge follows your finger. When you let go the host holds the simulator the way the Duo is shown, upright whenever it is closed (event folded; a fold whose hinge has not arrived within three seconds prints a warning with code foldFailed), and a second and a half later the picture is flat again. A fold takes about a third of a second. iOS lights the screen it lights at that angle, and the picture follows; shut, the host makes sure it is the outer screen, opening the hinge to 8 degrees and shutting it again if iOS has left the inner one lit, as it often does after the simulator has stood half open on the home screen. It does that too for a simulator it finds shut with its inner screen lit while a viewer is watching, which is the one time the host moves a hinge unasked.
The picture follows the simulator's screen: turned to landscape, by the app's Rotate button, by Simulator.app or by the app in front, it is streamed upright and wide, and touches still land where they are shown. The app can turn the simulator a quarter turn left or right, and turns an iPad simulator to fit the room it has for the picture (landscape when the room is wide), unless Fit to Screen is turned off or the simulator has been turned by hand. Either way the host streams the screen as HEVC video at up to 60 frames a second, with a bitrate that adapts to the link, to one viewer at a time. It replays the viewer's touches, with one or two fingers, and its Home, app switcher and Lock buttons. It prints one JSON line per event on standard output and its logs on standard error; with --udid:
{"event":"relays","relays":"https://eu1.relay.axe-cli.com","source":"published list"}
{"event":"endpoint","hostID":"<host ID>"}
{"event":"ready","relay":"<relay URL>","udid":"<UDID>"}
{"event":"viewerConnected"}
{"event":"streaming","height":"2296","width":"1056"}
{"event":"path","kind":"direct"}
{"event":"viewerDisconnected"}
{"event":"stopped"}
path has kind direct or relay. rotated (udid, orientation: portrait, landscapeLeft, landscapeRight or portraitUpsideDown) is printed when the simulator's screen turns, whoever turned it; touch coordinates change with it. On an iPhone Duo, screenChanged (udid, screen: outer or inner) is printed when the other screen lights, and folded (udid, posture: closed, tabletop, book, open, or angle for a hinge angle chosen by hand) when a fold the viewer asked for is done; one that fails prints a warning with code foldFailed. The other events are refused (viewer, reason), when a viewer that is not paired tries to connect, unpaired (viewer), when a connected viewer was removed with remote unpair and its session closed, warning (code, message) and error (message). A host that cannot listen for viewers prints error and stops with a failing status; one that has reached no relay after 20 seconds prints a warning with code relayUnreachable and keeps trying. Every value is a string. Ctrl+C, SIGTERM or closing its terminal (SIGHUP) stops the host, and the viewer is told at once.
Connections are encrypted from end to end (QUIC, through the iroh library). The two devices connect directly when they can and through a relay when they cannot; a relay cannot read the video or the touches. AXe reads its relay list from the DNS TXT record _relays.axe-cli.com and falls back to a built-in list. iroh's public relays are a last resort, for when none of AXe's answers. --relay-url <URL>, on remote, remote mirror and remote pair, uses that relay and no other; an address that is not one is refused.
If the stream is slow and the app shows Relay while both devices are on the same network, macOS is probably keeping axe off the local network. axe remote checks at start: it prints a warning, with the event warning and code localNetworkBlocked, and when a viewer on the same network connects, the host moves to the relay alone for it, which is slower than a direct connection but steady. That viewer reconnects by itself, once, after a few seconds. Viewers on other networks still connect directly. The host asks macOS again whenever a viewer on the same network arrives, so it returns to direct connections by itself once it is allowed. Allow the app you run axe from in System Settings > Privacy & Security > Local Network. Apple's Terminal and SSH sessions are always allowed; other terminal apps and launch agents need the permission.
axe remote mirror --udid "$UDID" --demo --demo-app com.example.MyApp--demo runs a public demo host: any viewer may connect without pairing, one at a time, for three minutes when someone else is waiting. It keeps the viewer inside one app: the hardware buttons are off, touches that start at the top or bottom edge of the screen are dropped, and the bitrate is capped. --demo-app names that app, and --demo is refused without it. It is started afresh for each visitor, and while one is connected the host checks four times a second which app is in front: if it is another, the visitor's touches are dropped and the app is brought back. The app is started with the arguments --launch-arg demo=1, so that it can hide whatever leads out of it; a text field does, because its menu offers Search Web and Share. If the app cannot be started, the host reports an error event and stops. A demo host has its own key, so it never opens this Mac's paired host.
axe remote needs an Apple silicon Mac with macOS 14.5 or later and works on simulators only; the rest of AXe is unchanged. The host key and the list of paired viewers are in ~/Library/Application Support/AXe/mirror/ (host.key, viewers.json), readable by you only. The commands were axe mirror … before AXe 2.2 (axe mirror viewers for axe remote devices), and still run under that name. The app's source is in AXeMirror/.
$ axe displays --udid "$UDID"
iPhone 18 Pro Max C096259C-C8FB-42E8-B2E5-8BBE4F8C5AE8
Active main 440×956 pt @3x portrait
id 1 C5182A5C-ECD6-48EE-A5A9-2D7707ED1542
displays waits for a fold or rotation to finish, then shows each screen's role (main on a one-screen device, outer or inner on the iPhone Duo), size in points, scale and orientation, which one is active, and the Duo's hinge angle. JSON is {udid, name, hinge?, activeScreen, otherScreens}. It fails with displayUnavailable while the simulator has not reported a consistent set of screens, as in the first seconds after boot, and with screensDidNotSettle if they keep changing; read again. Pass the active screen's id and uuid as --screen-id and --screen-uuid when a command must refuse to act on any other screen.
On the iPhone Duo:
axe hinge read --udid "$UDID"
axe hinge set tabletop --udid "$UDID" # 0...180, or closed, tabletop, open
axe rotate left --udid "$UDID"hinge read returns {udid, hinge: {degrees, mechanicalDegrees, posture}}: degrees is the angle iOS senses, mechanicalDegrees the angle hinge set drives, and posture is closed, partiallyOpen or open. hinge set sends one request, waits up to 8 seconds for the screens to settle (--no-wait skips this) and returns {udid, previousDegrees, hinge, activeScreen?}. rotate left|right works on the Duo and on physical devices and returns {udid, direction, previousRotation?, activeScreen?}; it is not the two-finger gesture rotate. Read the UI again after any of them. Failures: noHinge (one-screen simulator), bootChanged, hingeUnavailable, screensDidNotSettle, rotationFailed, plus the common codes. Duo-specific input, selected-screen input and capture are in the device reference.
axe settings changes device-wide settings on a booted simulator or a connected iPhone or iPad, through xcrun devicectl (Xcode 27 or later).
$ axe settings show --udid "$UDID"
Appearance light
Text size large
Increase Contrast off
Reduce Motion off
Reduce Transparency off
Show Borders off
Liquid Glass opacity 0.5
Colour filter off
VoiceOver off
axe settings set --udid "$UDID" --appearance dark --text-size accessibility-large
axe settings set --udid "$UDID" --color-filter grayscale --reduce-motion on
axe settings location set --latitude 37.7749 --longitude -122.4194 --udid "$UDID"
axe settings location scenarios --udid "$UDID"
axe settings location scenario "City Run" --udid "$UDID"
axe settings location clear --udid "$UDID"
axe settings status-bar preset screenshot --udid "$UDID" # also low-battery, no-service, charging
axe settings status-bar set --udid "$UDID" --time 9:41 --wifi-bars 3 --battery-level 100 --battery-state charged
axe settings status-bar clear --udid "$UDID"set accepts --appearance, --text-size, --increase-contrast, --reduce-motion, --reduce-transparency, --show-borders, --liquid-glass, --liquid-glass-opacity, --color-filter, --color-filter-intensity and --voiceover. It validates every value before changing anything and prints the result as show does. An accessibility text size turns Larger Accessibility Sizes on and a standard size turns it off, so setting the original size restores the device. JSON for show and set is {udid, appearance, textSize, increaseContrast, reduceMotion, reduceTransparency, showBorders, liquidGlass: {style?, opacity}, colorFilter: {enabled, type?, intensity?}, voiceOver}; a setting the device does not report is omitted.
Limits:
- iOS 27.2 offers one Liquid Glass style, so
--liquid-glassfails withsettingUnsupported;--liquid-glass-opacityworks. - Status bar overrides are simulator-only; on a physical device they fail with
settingUnsupported. - Turning VoiceOver on shows a one-time "VoiceOver Gestures" alert. It stays on screen after VoiceOver is turned off again, and blocks input, until you tap its OK button.
- A simulated location lasts until
settings location clear.
Failures: settingUnsupported, settingFailed (with devicectl's message), invalidArguments, targetNotFound, notBooted, and on a device that is not ready its doctor check code.
Add --agent to describe-ui, tap, type, swipe, drag, key, key-combo, key-sequence, slider, touch, gesture double-tap, gesture pinch and batch for checked, stateful control. A capture returns a snapshot ID and rows ref|actions|role|label|value, such as e9|tap|button|AXe Playground|. An action names a ref from that snapshot; AXe checks that the target is still the control you saw, sends the input, and returns the settled screen as a new capture.
axe describe-ui --agent --view navigation --udid "$UDID"
axe tap --agent --udid "$UDID" --snapshot-id "$SNAPSHOT_ID" --ref e9
axe type 'Ada' --agent --focus --udid "$UDID" --snapshot-id "$SNAPSHOT_ID" --ref e18
axe batch --agent --udid "$UDID" --steps-json '{"snapshotID":"<SNAPSHOT_ID>","steps":[{"action":"tap","ref":"e12"},{"action":"type","ref":"e7","text":"Ada","focus":true}]}'Web pages are listed too with --web: axe describe-ui --agent --web adds the links, buttons, fields and checkboxes of WKWebViews (in any app, whether or not they set isInspectable), Safari, SFSafariViewController and ASWebAuthenticationSession sign-in sheets as w rows such as w2|typeText|text-field|Email|. tap --ref w3, type --focus --ref w2 and key-sequence --ref w2 act on them, so an agent can fill in a form, pick from a drop-down or a search suggestion and move around a site or web app; page text is left to screenshots. Safari sheets also list Back, Forward, Reload and the keyboard's Done. A --web capture took about 0.29 s against 0.13 s without on an iPhone 18 Pro simulator (release build). See the agent reference.
Results are JSON by default; --output text prints the same result compactly. --view navigation lists controls, reading (the default) adds visible text, and full returns the complete schema version 1. A refusal sends no input and carries a typed code such as screenChanged, targetCovered, keyboardCovered, busy or observationFailed, usually with the current screen. AXe retries inside the call only when the screen or target changed and the target is the same control. Agent mode works on simulators only; a shut-down simulator reports notBooted. AXE_TIMING=1 prints a phase table to stderr after each agent command.
The AXe skill is the guide for agents; the agent reference has every code, limit and output field. --agent needs no model or API key and is separate from axe agent.
axe agent "<goal>" --udid <UDID> turns a natural-language goal into AXe actions with TypeSafe AI's Jev model, one checked action at a time, from the accessibility tree without screenshots. It needs TYPESAFE_API_KEY; values that the goal does not state need an OpenAI-compatible text model (AXE_TEXT_MODEL_API_KEY). Base URLs must use HTTPS, except for localhost, 127.0.0.1 or ::1.
axe agent "Open Settings and turn on Airplane Mode" --udid "$UDID"See docs/agent.md for configuration, tracing and limitations.
axe list-devices
axe doctor --udid "$DEVICE_UDID"
axe screenshot --udid "$DEVICE_UDID" --output device.png
axe describe-ui --udid "$DEVICE_UDID"
axe tap --udid "$DEVICE_UDID" --id "$ELEMENT_ID" --wait-timeout 15
axe record-video --udid "$DEVICE_UDID" --fps 3 --scale 0.5 --output device.mp4Pair the device in Xcode, enable Developer Mode and keep it unlocked; AXe never pairs, enables Developer Mode, mounts disk images or unlocks. doctor checks pairing, Developer Mode, connection, developer disk image, lock state and screenshot service, and a failed check ends with Error: <name> is not ready. (it also checks that a simulator is booted). Screenshots, video, accessibility reads, rotate, taps, swipes, drags, draw, gestures, touch --down --up, typing, keys, buttons, batches and settings (except the status bar) work with the hardware UDID.
If doctor reports "The CoreDevice service directory port was not found", AXe could not see macOS remoted's connection to the device. Some managed Macs hide network connections from programs that are not notarized, which includes the Homebrew build. The error ends with one line to paste in Terminal: your shell runs netstat, which lists the connection there, and passes the port to axe device-port, which checks it with the device and saves it. AXe uses the saved port until the device's tunnel is recreated, for example after a restart or reconnection; then the error prints a new line. axe device-port --udid "$DEVICE_UDID" prints the line at any time.
button lock needs --allow-lock. Agent mode, selected screens, displays, shutdown, hinge, clipboard, slider, side button, Apple Pay and the right-edge swipe preset return unsupportedOnDevice. Physical record-video prints the output path; JSON is {path, pixelWidth, pixelHeight, frames}, and --verbose prints the full receipt. A failed batch step keeps the step's own code. Device-specific codes include deviceLocked, rotationLocked, rotationUnconfirmed, displayOrientationMismatch and deviceStreamReplaced. Read the physical device reference for input rules and video, and docs/device-support.md for the design and limitations.
axe shutdown --udid "$UDID"
printf '%s' 'AXe sample' | axe clipboard copy --stdin --udid "$UDID"shutdown shuts down exactly one simulator by UUID through simctl and prints Shut down <udid> (was Booted) or <udid> was already shut down; JSON is {udid, initialState, outcome}. clipboard copy stages 1 to 65,536 UTF-8 bytes in one booted simulator's clipboard, verifies them by readback and prints Copied N bytes to the clipboard of <udid> (sha256 …); JSON is {udid, bytes, sha256}. It does not paste. Both report actionOutcomeUnknown when the effect could not be confirmed. See the clipboard reference.
axe list-simulators --device-set ~/sims # the simulators in that set
axe tap --label "Continue" --udid "$UDID" --device-set ~/sims
export AXE_DEVICE_SET_PATH=~/sims # or once, for every command in this shellAXe works in CoreSimulator's default device set unless you name another: the directory you give xcrun simctl --set <path>. --device-set <path> selects it for one command and AXE_DEVICE_SET_PATH for every command that inherits it; the flag wins when both are given. It replaces the default set for that command; it does not add to it, so a simulator in the default set is not found while another set is selected. The path must be an existing directory: AXe refuses one that is not, where CoreSimulator would create an empty set there. In batch and serve the set belongs to the whole run, so a step or a line that carries --device-set is refused.
Reading the UI, input, agent mode, screenshots, video, displays, doctor, batch, serve and shutdown all follow the selected set. So does the axe remote host: axe remote --device-set <path> offers the app that set's simulators and no others, and a simulator made in the app is made there. Two things do not, and stop with unsupportedInDeviceSet when AXE_DEVICE_SET_PATH is set: axe settings and axe clipboard copy reach the simulator through devicectl, which finds only simulators in the default set (xcrun simctl --set <path> ui, status_bar and pbcopy do those jobs there). Physical devices are not in any device set and ignore both.
AXe supports Xcode 26 and Xcode 27. Xcode 27 simulator automation uses Device Hub; Simulator.app is not required. Release artifacts are built once and run unchanged with either supported Xcode selected. Compatibility was validated with Xcode 26.5 (build 17F42) and iOS 26.5 (23F77), and with Xcode 27 Beta 3 (build 27A5218g) and iOS 27 (24A5380g). axe settings needs Xcode 27. With only Xcode 26 installed, simulators have no DTUHID touch service, so agent input, --input-mode selected and coordinate gestures send through the same Indigo input as the plain commands; a gesture with a system-edge hint fails with inputUnavailable.
AXe keeps its own copy of the IDB frameworks it uses, FBControlCore and FBSimulatorControl, in Packages/IDBKit; edit them directly. XcodeGen is required to generate their project. The AXe Mirror app for iPhone and iPad is in AXeMirror/, also an XcodeGen project.
make build # rebuilds the IDBKit frameworks only when stale, then swift build
make test # unit tests
make release-check # quick release checks in one run; see below
make e2e # whole Playground suite on dedicated iPhone, iPad and iPhone Duo simulators
make e2e-devices # opt-in run on connected iPhones and iPads
make bench-quick # quick A/B timing of direct commands against a baseline payloadmake release-check runs everything short of the end-to-end suites and reports each check: released CHANGELOG sections unchanged against origin/main, the script tests, the two skill copies identical, the licence files in the resource bundle identical to the root ones, the skill lint, no open items in docs/release-readiness.md, the release packaging dry run, and the unit tests. Every check runs even when one fails. RELEASE_CHECK_SKIP="skill lint,packaging" leaves checks out by name and RELEASE_CHECK_BASE changes the ref.
AXE_BUILD_ARCHS defaults to "arm64 x86_64"; set arm64 for local Duo work. make e2e creates missing simulators, needs Xcode 27.1 or later for the Playground's Duo hinge view, and exits 2 without an iPhone Duo runtime. make e2e-devices exits 1 before building when no device is paired. See Playground testing for simulator overrides and rerunning single groups. To validate a release payload under another Xcode, build the test bundle with that Xcode, then run AXE_BIN_PATH=/path/to/release/axe ./test-runner.sh --tests-only.
benchmarks/ compares AXe with its best accepted baseline and with FlowDeck and RocketSim on Weather, Contacts and Reminders tasks, recording calls, time and returned tokens. Each run builds and measures the current source.
./benchmarks/run setup # then set Xcode, a warm simulator and tool paths in benchmarks/config.local.json
./benchmarks/run doctor
./benchmarks/run
./benchmarks/run --tools axe --scenarios weatherReports stay under benchmarks/history/, which Git ignores; accepted baselines are in benchmarks/baselines.json.
Full documentation is available at axe-cli.com/docs.
AXe is an independent open-source iOS Simulator automation project and is not affiliated with, endorsed by, or associated with Deque Systems or its axe® accessibility products.
Pull requests are welcome. Read CONTRIBUTING.md first: it sets out the licence terms that apply to contributions.
AXe is licensed under the GNU General Public License version 3 only (GPL-3.0-only). See LICENSE.
Running axe to test an app does not put that app under the GPL. If you distribute AXe, or software that contains AXe's code, you must do so under the GPL and make the corresponding source available.
To use AXe's code in software you do not release under the GPL, you need a commercial licence. Contact web@cameroncooke.com.
AXe releases up to and including v2.0.4, and all AXe source published before the change to the GPL, were released under the MIT License and remain available under it. That notice, the notice for Meta's IDB frameworks (MIT) and the licences of iroh (MIT or Apache 2.0), which axe remote uses, are in THIRD_PARTY_LICENSES.
The keyboard signal detector is adapted from sim-use commit c02295ed under Apache 2.0. Its licence and upstream NOTICE are included in AXe's resource bundle, with the source and changes listed in ADAPTATION.md. AXe's own licence, and THIRD_PARTY_LICENSES, are in the bundle too, under licenses/axe.
