iOS Simulator Skill
Build, test, and automate iOS applications using accessibility-driven navigation and structured data instead of pixel coordinates.
Quick Start
# 1. Check environment
bash scripts/sim_health_check.sh
# 2. Launch app
python scripts/app_launcher.py --launch com.example.app
# 3. Map screen to see elements
python scripts/screen_mapper.py
# 4. Tap button
python scripts/navigator.py --find-text "Login" --tap
# 5. Enter text
python scripts/navigator.py --find-type TextField --enter-text "user@example.com"
All scripts support --help for detailed options and --json for machine-readable output.
Navigation Strategy
Always prefer the accessibility tree over screenshots for navigation. The accessibility tree gives you element types, labels, frames, and tap targets — structured data that's cheaper and more reliable than image analysis.
Use this priority:
screen_mapper.py → structured element list (5-7 lines, ~10 tokens)
navigator.py --find-text/--find-type/--find-id → semantic interaction
- Screenshots → only for visual verification, bug reports, or visual diff
Screenshots cost 1,600–6,300 tokens depending on size. The accessibility tree costs 10–50 tokens in default mode.
21 Production Scripts
Build & Development (2 scripts)
build_and_test.py - Build Xcode projects, run tests, parse results with progressive disclosure
- Build with live result streaming
- Parse errors and warnings from xcresult bundles
- Retrieve detailed build logs on demand
- Options:
--project, --scheme, --clean, --test, --verbose, --json
log_monitor.py - Real-time log monitoring with intelligent filtering
- Stream logs or capture by duration
- Filter by severity (error/warning/info/debug)
- Deduplicate repeated messages
- Options:
--app, --severity, --follow, --duration, --output, --json
Navigation & Interaction (5 scripts)
screen_mapper.py - Analyze current screen and list interactive elements
- Element type breakdown
- Interactive button list
- Text field status
- Options:
--verbose, --hints, --json
navigator.py - Find and interact with elements semantically
- Find by text (fuzzy matching)
- Find by element type
- Find by accessibility ID
- Enter text or tap elements
- Options:
--find-text, --find-type, --find-id, --tap, --enter-text, --json
gesture.py - Perform swipes, scrolls, pinches, and complex gestures
- Directional swipes (up/down/left/right)
- Multi-swipe scrolling
- Pinch zoom
- Long press
- Pull to refresh
- Options:
--swipe, --scroll, --pinch, --long-press, --refresh, --json
keyboard.py - Text input and hardware button control
- Type text (fast or slow)
- Special keys (return, delete, tab, space, arrows)
- Hardware buttons (home, lock, volume, screenshot)
- Key combinations
- Options:
--type, --key, --button, --slow, --clear, --dismiss, --json
app_launcher.py - App lifecycle management
- Launch apps by bundle ID
- Terminate apps
- Install/uninstall from .app bundles
- Deep link navigation
- List installed apps
- Check app state
- Options:
--launch, --terminate, --install, --uninstall, --open-url, --list, --state, --json
Testing & Analysis (5 scripts)
accessibility_audit.py - Check WCAG compliance on current screen
- Critical issues (missing labels, empty buttons, no alt text)
- Warnings (missing hints, small touch targets)
- Info (missing IDs, deep nesting)
- Options:
--verbose, --output, --json
visual_diff.py - Compare two screenshots for visual changes
- Pixel-by-pixel comparison
- Threshold-based pass/fail
- Generate diff images
- Options:
--threshold, --output, --details, --json
test_recorder.py - Automatically document test execution
- Capture screenshots and accessibility trees per step
- Generate markdown reports with timing data
- Options:
--test-name, --output, --verbose, --json
app_state_capture.py - Create comprehensive debugging snapshots
- Screenshot, UI hierarchy, app logs, device info
- Markdown summary for bug reports
- Options:
--app-bundle-id, --output, --log-lines, --json
sim_health_check.sh - Verify environment is properly configured
- Check macOS, Xcode, simctl, IDB, Python
- List available and booted simulators
- Verify Python packages (Pillow)
Advanced Testing & Permissions (4 scripts)
clipboard.py - Manage simulator clipboard for paste testing
- Copy text to clipboard
- Test paste flows without manual entry
- Options:
--copy, --test-name, --expected, --json
status_bar.py - Override simulator status bar appearance
- Presets: clean (9:41, 100% battery), testing (11:11, 50%), low-battery (20%), airplane (offline)
- Custom time, network, battery, WiFi settings
- Options:
--preset, --time, --data-network, --battery-level, --clear, --json
push_notification.py - Send simulated push notifications
- Simple mode (title + body + badge)
- Custom JSON payloads
- Test notification handling and deep links
- Options:
--bundle-id, --title, --body, --badge, --payload, --json
privacy_manager.py - Grant, revoke, and reset app permissions
- 13 supported services (camera, microphone, location, contacts, photos, calendar, health, etc.)
- Batch operations (comma-separated services)
- Audit trail with test scenario tracking
- Options:
--bundle-id, --grant, --revoke, --reset, --list, --json
Device Lifecycle Management (5 scripts)
simctl_boot.py - Boot simulators with optional readiness verification
- Boot by UDID or device name
- Wait for device ready with timeout
- Batch boot operations (--all, --type)
- Performance timing
- Options:
--udid, --name, --wait-ready, --timeout, --all, --type, --json
simctl_shutdown.py - Gracefully shutdown simulators
- Shutdown by UDID or device name
- Optional verification of shutdown completion
- Batch shutdown operations
- Options:
--udid, --name, --verify, --timeout, --all, --type, --json
simctl_create.py - Create simulators dynamically
- Create by device type and iOS version
- List available device types and runtimes
- Custom device naming
- Returns UDID for CI/CD integration
- Options:
--device, --runtime, --name, --list-devices, --list-runtimes, --json
simctl_delete.py - Permanently delete simulators
- Delete by UDID or device name
- Safety confirmation by default (skip with --yes)
- Batch delete operations
- Smart deletion (--old N to keep N per device type)
- Options:
--udid, --name, --yes, --all, --type, --old, --json
simctl_erase.py - Factory reset simulators without deletion
- Preserve device UUID (faster than delete+create)
- Erase all, by type, or booted simulators
- Optional verification
- Options:
--udid, --name, --verify, --timeout, --all, --type, --booted, --json
Common Patterns
Auto-UDID Detection: Most scripts auto-detect the booted simulator if --udid is not provided.
Device Name Resolution: Use device names (e.g., "iPhone 16 Pro") instead of UDIDs - scripts resolve automatically.
Batch Operations: Many scripts support --all for all simulators or --type iPhone for device type filtering.
Output Formats: Default is concise human-readable output. Use --json for machine-readable output in CI/CD.
Help: All scripts support --help for detailed options and examples.
Screenshot Sizing: Screenshots are resized to save tokens. Presets: full (3-4 tiles, ~5K tokens), half (1 tile, ~1.6K tokens, default), quarter (1 tile, ~800 tokens, less detail). Use quarter for quick visual checks, half for readable UI, full only when pixel-level detail matters. Scripts that capture screenshots (app_state_capture.py, test_recorder.py) default to half.
Typical Workflow
- Verify environment:
bash scripts/sim_health_check.sh
- Launch app:
python scripts/app_launcher.py --launch com.example.app
- Analyze screen:
python scripts/screen_mapper.py
- Interact:
python scripts/navigator.py --find-text "Button" --tap
- Verify:
python scripts/accessibility_audit.py
- Debug if needed:
python scripts/app_state_capture.py --app-bundle-id com.example.app
Requirements
- macOS 12+
- Xcode Command Line Tools
- Python 3
- IDB (optional, for interactive features)
Documentation
- SKILL.md (this file) - Script reference and quick start
- README.md - Installation and examples
- CLAUDE.md - Architecture and implementation details
- references/ - Deep documentation on specific topics
- examples/ - Complete automation workflows
Key Design Principles
Semantic Navigation: Find elements by meaning (text, type, ID) not pixel coordinates. Survives UI changes.
Token Efficiency: Concise default output (3-5 lines) with optional verbose and JSON modes for detailed results.
Accessibility-First: Built on standard accessibility APIs for reliability and compatibility.
Zero Configuration: Works immediately on any macOS with Xcode. No setup required.
Structured Data: Scripts output JSON or formatted text, not raw logs. Easy to parse and integrate.
Auto-Learning: Build system remembers your device preference. Configuration stored per-project.
Use these scripts directly or let Claude Code invoke them automatically when your request matches the skill description.
1---2name: ios-simulator-skill3description: 21 production-ready scripts for iOS app testing, building, and automation. Provides semantic UI navigation, build automation, accessibility testing, and simulator lifecycle management. Optimized for AI agents with minimal token output.4---5
6# iOS Simulator Skill
7
8Build, test, and automate iOS applications using accessibility-driven navigation and structured data instead of pixel coordinates.
9
10## Quick Start
11
12```bash
13# 1. Check environment
14bash scripts/sim_health_check.sh
15
16# 2. Launch app
17python scripts/app_launcher.py --launch com.example.app
18
19# 3. Map screen to see elements
20python scripts/screen_mapper.py
21
22# 4. Tap button
23python scripts/navigator.py --find-text "Login" --tap
24
25# 5. Enter text
26python scripts/navigator.py --find-type TextField --enter-text "user@example.com"
27```
28
29All scripts support `--help` for detailed options and `--json` for machine-readable output.
30
31## Navigation Strategy
32
33**Always prefer the accessibility tree over screenshots for navigation.** The accessibility tree gives you element types, labels, frames, and tap targets — structured data that's cheaper and more reliable than image analysis.
34
35Use this priority:
361. `screen_mapper.py` → structured element list (5-7 lines, ~10 tokens)
372. `navigator.py --find-text/--find-type/--find-id` → semantic interaction
383. Screenshots → only for visual verification, bug reports, or visual diff
39
40Screenshots cost 1,600–6,300 tokens depending on size. The accessibility tree costs 10–50 tokens in default mode.
41
42## 21 Production Scripts
43
44### Build & Development (2 scripts)
45
461. **build_and_test.py** - Build Xcode projects, run tests, parse results with progressive disclosure
47 - Build with live result streaming
48 - Parse errors and warnings from xcresult bundles
49 - Retrieve detailed build logs on demand
50 - Options: `--project`, `--scheme`, `--clean`, `--test`, `--verbose`, `--json`
51
522. **log_monitor.py** - Real-time log monitoring with intelligent filtering
53 - Stream logs or capture by duration
54 - Filter by severity (error/warning/info/debug)
55 - Deduplicate repeated messages
56 - Options: `--app`, `--severity`, `--follow`, `--duration`, `--output`, `--json`
57
58### Navigation & Interaction (5 scripts)
59
603. **screen_mapper.py** - Analyze current screen and list interactive elements
61 - Element type breakdown
62 - Interactive button list
63 - Text field status
64 - Options: `--verbose`, `--hints`, `--json`
65
664. **navigator.py** - Find and interact with elements semantically
67 - Find by text (fuzzy matching)
68 - Find by element type
69 - Find by accessibility ID
70 - Enter text or tap elements
71 - Options: `--find-text`, `--find-type`, `--find-id`, `--tap`, `--enter-text`, `--json`
72
735. **gesture.py** - Perform swipes, scrolls, pinches, and complex gestures
74 - Directional swipes (up/down/left/right)
75 - Multi-swipe scrolling
76 - Pinch zoom
77 - Long press
78 - Pull to refresh
79 - Options: `--swipe`, `--scroll`, `--pinch`, `--long-press`, `--refresh`, `--json`
80
816. **keyboard.py** - Text input and hardware button control
82 - Type text (fast or slow)
83 - Special keys (return, delete, tab, space, arrows)
84 - Hardware buttons (home, lock, volume, screenshot)
85 - Key combinations
86 - Options: `--type`, `--key`, `--button`, `--slow`, `--clear`, `--dismiss`, `--json`
87
887. **app_launcher.py** - App lifecycle management
89 - Launch apps by bundle ID
90 - Terminate apps
91 - Install/uninstall from .app bundles
92 - Deep link navigation
93 - List installed apps
94 - Check app state
95 - Options: `--launch`, `--terminate`, `--install`, `--uninstall`, `--open-url`, `--list`, `--state`, `--json`
96
97### Testing & Analysis (5 scripts)
98
998. **accessibility_audit.py** - Check WCAG compliance on current screen
100 - Critical issues (missing labels, empty buttons, no alt text)
101 - Warnings (missing hints, small touch targets)
102 - Info (missing IDs, deep nesting)
103 - Options: `--verbose`, `--output`, `--json`
104
1059. **visual_diff.py** - Compare two screenshots for visual changes
106 - Pixel-by-pixel comparison
107 - Threshold-based pass/fail
108 - Generate diff images
109 - Options: `--threshold`, `--output`, `--details`, `--json`
110
11110. **test_recorder.py** - Automatically document test execution
112 - Capture screenshots and accessibility trees per step
113 - Generate markdown reports with timing data
114 - Options: `--test-name`, `--output`, `--verbose`, `--json`
115
11611. **app_state_capture.py** - Create comprehensive debugging snapshots
117 - Screenshot, UI hierarchy, app logs, device info
118 - Markdown summary for bug reports
119 - Options: `--app-bundle-id`, `--output`, `--log-lines`, `--json`
120
12112. **sim_health_check.sh** - Verify environment is properly configured
122 - Check macOS, Xcode, simctl, IDB, Python
123 - List available and booted simulators
124 - Verify Python packages (Pillow)
125
126### Advanced Testing & Permissions (4 scripts)
127
12813. **clipboard.py** - Manage simulator clipboard for paste testing
129 - Copy text to clipboard
130 - Test paste flows without manual entry
131 - Options: `--copy`, `--test-name`, `--expected`, `--json`
132
13314. **status_bar.py** - Override simulator status bar appearance
134 - Presets: clean (9:41, 100% battery), testing (11:11, 50%), low-battery (20%), airplane (offline)
135 - Custom time, network, battery, WiFi settings
136 - Options: `--preset`, `--time`, `--data-network`, `--battery-level`, `--clear`, `--json`
137
13815. **push_notification.py** - Send simulated push notifications
139 - Simple mode (title + body + badge)
140 - Custom JSON payloads
141 - Test notification handling and deep links
142 - Options: `--bundle-id`, `--title`, `--body`, `--badge`, `--payload`, `--json`
143
14416. **privacy_manager.py** - Grant, revoke, and reset app permissions
145 - 13 supported services (camera, microphone, location, contacts, photos, calendar, health, etc.)
146 - Batch operations (comma-separated services)
147 - Audit trail with test scenario tracking
148 - Options: `--bundle-id`, `--grant`, `--revoke`, `--reset`, `--list`, `--json`
149
150### Device Lifecycle Management (5 scripts)
151
15217. **simctl_boot.py** - Boot simulators with optional readiness verification
153 - Boot by UDID or device name
154 - Wait for device ready with timeout
155 - Batch boot operations (--all, --type)
156 - Performance timing
157 - Options: `--udid`, `--name`, `--wait-ready`, `--timeout`, `--all`, `--type`, `--json`
158
15918. **simctl_shutdown.py** - Gracefully shutdown simulators
160 - Shutdown by UDID or device name
161 - Optional verification of shutdown completion
162 - Batch shutdown operations
163 - Options: `--udid`, `--name`, `--verify`, `--timeout`, `--all`, `--type`, `--json`
164
16519. **simctl_create.py** - Create simulators dynamically
166 - Create by device type and iOS version
167 - List available device types and runtimes
168 - Custom device naming
169 - Returns UDID for CI/CD integration
170 - Options: `--device`, `--runtime`, `--name`, `--list-devices`, `--list-runtimes`, `--json`
171
17220. **simctl_delete.py** - Permanently delete simulators
173 - Delete by UDID or device name
174 - Safety confirmation by default (skip with --yes)
175 - Batch delete operations
176 - Smart deletion (--old N to keep N per device type)
177 - Options: `--udid`, `--name`, `--yes`, `--all`, `--type`, `--old`, `--json`
178
17921. **simctl_erase.py** - Factory reset simulators without deletion
180 - Preserve device UUID (faster than delete+create)
181 - Erase all, by type, or booted simulators
182 - Optional verification
183 - Options: `--udid`, `--name`, `--verify`, `--timeout`, `--all`, `--type`, `--booted`, `--json`
184
185## Common Patterns
186
187**Auto-UDID Detection**: Most scripts auto-detect the booted simulator if --udid is not provided.
188
189**Device Name Resolution**: Use device names (e.g., "iPhone 16 Pro") instead of UDIDs - scripts resolve automatically.
190
191**Batch Operations**: Many scripts support `--all` for all simulators or `--type iPhone` for device type filtering.
192
193**Output Formats**: Default is concise human-readable output. Use `--json` for machine-readable output in CI/CD.
194
195**Help**: All scripts support `--help` for detailed options and examples.
196
197**Screenshot Sizing**: Screenshots are resized to save tokens. Presets: `full` (3-4 tiles, ~5K tokens), `half` (1 tile, ~1.6K tokens, default), `quarter` (1 tile, ~800 tokens, less detail). Use `quarter` for quick visual checks, `half` for readable UI, `full` only when pixel-level detail matters. Scripts that capture screenshots (`app_state_capture.py`, `test_recorder.py`) default to `half`.
198
199## Typical Workflow
200
2011. Verify environment: `bash scripts/sim_health_check.sh`
2022. Launch app: `python scripts/app_launcher.py --launch com.example.app`
2033. Analyze screen: `python scripts/screen_mapper.py`
2044. Interact: `python scripts/navigator.py --find-text "Button" --tap`
2055. Verify: `python scripts/accessibility_audit.py`
2066. Debug if needed: `python scripts/app_state_capture.py --app-bundle-id com.example.app`
207
208## Requirements
209
210- macOS 12+
211- Xcode Command Line Tools
212- Python 3
213- IDB (optional, for interactive features)
214
215## Documentation
216
217- **SKILL.md** (this file) - Script reference and quick start
218- **README.md** - Installation and examples
219- **CLAUDE.md** - Architecture and implementation details
220- **references/** - Deep documentation on specific topics
221- **examples/** - Complete automation workflows
222
223## Key Design Principles
224
225**Semantic Navigation**: Find elements by meaning (text, type, ID) not pixel coordinates. Survives UI changes.
226
227**Token Efficiency**: Concise default output (3-5 lines) with optional verbose and JSON modes for detailed results.
228
229**Accessibility-First**: Built on standard accessibility APIs for reliability and compatibility.
230
231**Zero Configuration**: Works immediately on any macOS with Xcode. No setup required.
232
233**Structured Data**: Scripts output JSON or formatted text, not raw logs. Easy to parse and integrate.
234
235**Auto-Learning**: Build system remembers your device preference. Configuration stored per-project.
236
237---
238
239Use these scripts directly or let Claude Code invoke them automatically when your request matches the skill description.