Skip to content

Instantly share code, notes, and snippets.

@clayton
Created December 13, 2025 23:30
Show Gist options
  • Select an option

  • Save clayton/b59d739fe32dfb1482abd178ffbfae02 to your computer and use it in GitHub Desktop.

Select an option

Save clayton/b59d739fe32dfb1482abd178ffbfae02 to your computer and use it in GitHub Desktop.
Claude Code Skill for using AXe

name: ios-simulator-axe description: Interact with iOS Simulators using AXe CLI. Use when testing iOS apps, navigating UI, verifying screens, tapping buttons, or automating simulator interactions. Requires a booted simulator.

iOS Simulator Automation with AXe

Overview

AXe is a CLI tool for automating iOS Simulators using Apple's Accessibility APIs. It allows Claude to interact with running iOS apps - reading UI elements, tapping buttons, typing text, and navigating through screens.

When to Use

Trigger this skill when:

  • User asks to test an iOS app in the simulator
  • User wants to verify UI changes visually
  • User asks to navigate through app screens
  • User wants to check accessibility labels
  • User asks to interact with the simulator (tap, type, swipe)
  • User wants to walk through a user flow

Quick Start

1. Find the booted simulator:

axe list-simulators 2>/dev/null | grep -i "booted"

2. Describe current screen:

axe describe-ui --udid SIMULATOR_UDID 2>&1 | grep -v "objc\["

3. Extract just the labels (quick view):

axe describe-ui --udid SIMULATOR_UDID 2>&1 | grep -v "objc\[" | grep "AXLabel"

Commands Reference

Information Commands

List simulators:

axe list-simulators
# Output: UDID | Device Name | State | Runtime

Describe UI (get accessibility tree):

axe describe-ui --udid UDID
# Returns JSON with all UI elements, frames, labels, types

Touch & Tap Commands

Tap at coordinates:

axe tap -x 210 -y 400 --udid UDID

Tap with delay (wait before/after):

axe tap -x 210 -y 400 --pre-delay 500 --post-delay 300 --udid UDID

Gesture Commands

Swipe:

axe swipe --from-x 200 --from-y 600 --to-x 200 --to-y 200 --udid UDID

Scroll presets:

axe scroll-up --udid UDID
axe scroll-down --udid UDID
axe scroll-left --udid UDID
axe scroll-right --udid UDID

Edge swipes (navigation):

axe swipe-from-left-edge --udid UDID   # Back gesture
axe swipe-from-right-edge --udid UDID
axe swipe-from-top-edge --udid UDID    # Control center
axe swipe-from-bottom-edge --udid UDID # Home indicator

Text Input

Type text:

axe type "Hello World" --udid UDID

Press specific key:

axe key 40 --udid UDID  # Enter key
axe key 42 --udid UDID  # Backspace

Hardware Buttons

axe button home --udid UDID
axe button lock --udid UDID
axe button siri --udid UDID

Common Workflows

Navigate Through Onboarding

# Get UDID
UDID=$(axe list-simulators 2>/dev/null | grep -i "booted" | head -1 | cut -d'|' -f1 | tr -d ' ')

# See current screen
axe describe-ui --udid $UDID 2>&1 | grep -v "objc\[" | grep "AXLabel"

# Tap a button (find coordinates from describe-ui frame data)
axe tap -x 210 -y 750 --udid $UDID

# Verify next screen
sleep 0.5 && axe describe-ui --udid $UDID 2>&1 | grep -v "objc\[" | grep "AXLabel"

Find and Tap a Button

  1. Run describe-ui to get the JSON
  2. Find the button by its AXLabel
  3. Use the frame coordinates (calculate center: x + width/2, y + height/2)
  4. Run tap at those coordinates

Example:

{
  "AXLabel": "Continue",
  "frame": { "x": 30, "y": 700, "width": 360, "height": 50 }
}

Tap center: axe tap -x 210 -y 725 --udid UDID

Verify Accessibility Labels

# Check all labels on screen
axe describe-ui --udid $UDID 2>&1 | grep -v "objc\[" | grep "AXLabel"

# Look for specific element
axe describe-ui --udid $UDID 2>&1 | grep -v "objc\[" | grep -i "button_name"

Fill a Form

# Tap text field (find coordinates first)
axe tap -x 200 -y 300 --udid $UDID

# Type into it
axe type "[email protected]" --udid $UDID

# Tap next field
axe tap -x 200 -y 380 --udid $UDID

# Type password
axe type "password123" --udid $UDID

# Submit
axe tap -x 200 -y 500 --udid $UDID

Tips

Suppress warnings: The tool may output objc warnings - filter them:

axe describe-ui --udid UDID 2>&1 | grep -v "objc\["

Finding coordinates:

  • The frame in describe-ui output gives {x, y, width, height}
  • Tap the center: x + width/2, y + height/2

Timing:

  • Use sleep 0.3 or sleep 0.5 between actions for animations
  • Use --pre-delay and --post-delay flags for precise timing

Multiple actions:

axe tap -x 100 -y 200 --udid $UDID && sleep 0.3 && axe describe-ui --udid $UDID 2>&1 | grep "AXLabel"

Limitations

  • Only works with booted simulators (not physical devices)
  • Requires accessibility to be working in the app
  • Some custom UI elements may not expose accessibility info
  • Coordinates are in screen points, not pixels

Success Criteria

  • list-simulators shows at least one booted simulator
  • describe-ui returns JSON with UI elements
  • tap commands report "completed successfully"
  • Navigation between screens works as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment