this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add axe skill for iOS Simulator control

Provides commands for UI automation via accessibility APIs:
- describe-ui: Get accessibility tree
- tap: By label, ID, or coordinates
- type: Text input
- swipe: Gesture with start/end coords
- button: Hardware buttons (home, lock)

Includes common gotchas for sheet timing, multiple simulators,
and empty accessibility tree debugging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

alice c27be60e 4a8ac5cd

+128
+128
skills/axe/SKILL.md
··· 1 + --- 2 + name: axe 3 + description: Control iOS Simulators via accessibility APIs. Use this skill when the user wants to automate iOS simulator interactions, tap buttons by accessibility label, type text, swipe, take screenshots, describe the UI accessibility tree, or test iOS apps programmatically. 4 + --- 5 + 6 + # axe - iOS Simulator Accessibility Control 7 + 8 + Control iOS Simulators using accessibility APIs for UI automation and testing. 9 + 10 + ## Prerequisites 11 + 12 + - Xcode with iOS Simulator 13 + - `axe` CLI in PATH 14 + 15 + ## Getting Simulator UDID 16 + 17 + Always use explicit UDIDs when multiple simulators might be running: 18 + 19 + ```bash 20 + # List available simulators 21 + xcrun simctl list devices available 22 + 23 + # List only booted simulators 24 + xcrun simctl list devices booted 25 + 26 + # Boot a simulator 27 + xcrun simctl boot "iPhone 17 Pro" 28 + 29 + # Shutdown 30 + xcrun simctl shutdown booted 31 + xcrun simctl shutdown <UDID> 32 + ``` 33 + 34 + ## axe Commands 35 + 36 + ### Describe UI (Accessibility Tree) 37 + 38 + Get the full accessibility tree to find elements: 39 + 40 + ```bash 41 + axe describe-ui --udid <UDID> 42 + ``` 43 + 44 + ### Tap Elements 45 + 46 + ```bash 47 + # By accessibility label (preferred) 48 + axe tap --udid <UDID> --label "Button Label" 49 + 50 + # By accessibility identifier 51 + axe tap --udid <UDID> --id "buttonIdentifier" 52 + 53 + # By coordinates (fallback, e.g., for tab bars) 54 + axe tap --udid <UDID> -x 352 -y 832 55 + ``` 56 + 57 + ### Type Text 58 + 59 + ```bash 60 + axe type --udid <UDID> --text "Hello world" 61 + ``` 62 + 63 + ### Swipe 64 + 65 + **IMPORTANT**: Uses `--start-x/--start-y/--end-x/--end-y`, NOT `--from-x/--to-x`: 66 + 67 + ```bash 68 + # Swipe up (scroll down) 69 + axe swipe --udid <UDID> --start-x 200 --start-y 600 --end-x 200 --end-y 300 70 + 71 + # Swipe down (scroll up) 72 + axe swipe --udid <UDID> --start-x 200 --start-y 300 --end-x 200 --end-y 600 73 + ``` 74 + 75 + ### Hardware Buttons 76 + 77 + ```bash 78 + axe button --udid <UDID> --name home 79 + axe button --udid <UDID> --name lock 80 + ``` 81 + 82 + ## Screenshots (via simctl) 83 + 84 + ```bash 85 + xcrun simctl io booted screenshot /tmp/screenshot.png 86 + xcrun simctl io <UDID> screenshot /tmp/screenshot.png 87 + ``` 88 + 89 + ## Common Gotchas 90 + 91 + ### axe swipe parameters 92 + Use `--start-x/--start-y/--end-x/--end-y`, NOT `--from-x/--to-x`. This is a common mistake. 93 + 94 + ### simctl has no input command 95 + `xcrun simctl io` only supports `screenshot` and `recordVideo`. For touch/swipe input, use `axe`. 96 + 97 + ### Sheet/modal timing 98 + When opening a sheet and immediately tapping a button inside, add `sleep 0.5` between actions. The sheet needs time to fully present before buttons are tappable. 99 + 100 + ### Multiple simulators 101 + Always use explicit UDID, not "booted", when multiple simulators are running. Check with `xcrun simctl list devices booted`. 102 + 103 + ### iOS 26+ Toggle issues 104 + axe taps don't reliably trigger SwiftUI Toggle actions on iOS 26+. Manual testing may be required for toggle interactions. 105 + 106 + ### Entitlements require signing 107 + `CODE_SIGNING_ALLOWED=NO` prevents entitlements (like HealthKit) from being applied. Use ad-hoc signing for entitlement-dependent features. 108 + 109 + ### Empty accessibility tree 110 + If `axe describe-ui` returns an empty tree (frame `{0,0,0,0}`, no children) even though the app is visibly running, the simulator has entered a bad state. Fix by rebooting: 111 + 112 + ```bash 113 + xcrun simctl shutdown <UDID> && xcrun simctl boot <UDID> 114 + ``` 115 + 116 + This is not an app code issue. 117 + 118 + ### Tab bar items 119 + Tab bar items often require coordinates instead of labels. Use `axe describe-ui` to find element frames, then tap by coordinates. Tab bars are typically around y~832 on standard iPhone sizes. 120 + 121 + ## Recommended Workflow 122 + 123 + - Run `xcrun simctl list devices booted` to get the UDID 124 + - Use `axe describe-ui --udid <UDID>` to explore the accessibility tree 125 + - Prefer `--label` for tapping when possible (more resilient to layout changes) 126 + - Fall back to coordinates for elements without accessible labels 127 + - Add `sleep 0.5` between actions that trigger animations/transitions 128 + - Take screenshots with `xcrun simctl io` to verify state