| name | axe |
| description | iOS Simulator automation and interaction using the AXe CLI tool. Use when working with iOS simulators for UI automation, testing, accessibility verification, or screen recording. Specific use cases include simulating touches and gestures (tap, swipe), entering text, pressing hardware buttons (home, lock, Siri), recording or streaming simulator video, extracting UI accessibility information, or automating iOS simulator interactions. Assumes axe CLI is already installed. |
AXe - iOS Simulator Automation
Automate iOS Simulator interactions using the AXe command-line tool, which leverages Apple's Accessibility APIs for UI testing, automation, and verification.
Quick Start
All AXe commands require the simulator UDID. Get it first:
axe list-simulators
UDID=$(axe list-simulators | grep "iPhone 15 Pro" | awk '{print $NF}')
Core Operations
Touch & Gesture Automation
Tap at coordinates:
axe tap -x 100 -y 200 --udid $UDID
Swipe between points:
axe swipe --start-x 300 --start-y 200 --end-x 100 --end-y 200 --udid $UDID
Use gesture presets:
axe gesture scroll-down --udid $UDID
axe gesture swipe-from-left-edge --udid $UDID
Text Input
axe type 'Hello World!' --udid $UDID
echo "Test message" | axe type --stdin --udid $UDID
axe type --file message.txt --udid $UDID
Hardware Buttons
axe button home --udid $UDID
axe button lock --udid $UDID
axe button siri --udid $UDID
axe button lock --duration 2.0 --udid $UDID
Video Recording & Streaming
Direct recording:
axe record-video --udid $UDID --fps 30 --output recording.mp4
Streaming:
axe stream-video --udid $UDID --fps 30 --format ffmpeg | \
ffmpeg -f image2pipe -framerate 30 -i - output.mp4
UI Accessibility Information
axe describe-ui --udid $UDID
axe describe-ui --point 150,300 --udid $UDID
Automation Workflow Patterns
Sequential Actions with Timing
Use --pre-delay and --post-delay for reliable automation:
axe tap -x 150 -y 300 --pre-delay 0.5 --udid $UDID
axe tap -x 150 -y 300 --post-delay 1.0 --udid $UDID
axe tap -x 100 -y 200 --post-delay 0.5 --udid $UDID
axe type 'username' --post-delay 0.3 --udid $UDID
axe tap -x 100 -y 300 --post-delay 0.5 --udid $UDID
axe type 'password' --post-delay 0.3 --udid $UDID
axe button home --udid $UDID
Multi-Step Test Scenarios
UDID=$(axe list-simulators | grep "iPhone 15" | head -1 | awk '{print $NF}')
axe tap -x 187 -y 300 --post-delay 0.5 --udid $UDID
axe type 'testuser@example.com' --post-delay 0.5 --udid $UDID
axe tap -x 187 -y 400 --post-delay 0.5 --udid $UDID
axe type 'password123' --post-delay 0.5 --udid $UDID
axe tap -x 187 -y 500 --post-delay 2.0 --udid $UDID
Command Reference
For complete command documentation including all options and parameters, see commands.md.
Quick reference of available commands:
tap, swipe, touch - Touch and gesture simulation
gesture - Pre-configured gesture presets
type - Text input with automatic shift handling
button - Hardware button simulation (home, lock, siri, apple-pay)
key, key-sequence - Low-level keyboard control with HID keycodes
stream-video, record-video - Video capture and streaming
describe-ui - Extract accessibility information
list-simulators - List available simulators
Tips
Get UI coordinates: Use describe-ui to find element positions before automating taps.
Simulator state: Ensure the target simulator is booted before running commands.
Timing strategy: Start with longer delays (0.5-1.0s) and reduce as needed for reliable automation.
Video recording: Always press Ctrl+C to properly finalize MP4 files. The output path is printed to stdout.
UDID management: Store UDID in a variable for cleaner scripts and reusability.