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.
For IDB-driven runs, optimize for warm-session reuse and minimal refreshes.
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.
Fast IDB Workflow (Latency-Optimized)
- Pick one simulator per session and keep using it (same UDID/device) unless the test explicitly requires a different device.
- Reuse one warm IDB companion/session across steps. Avoid reconnecting or restarting the companion between each command.
- Use targeted actions first (find/tap/type) and refresh state only when needed:
- Run focused queries (
navigator.py / screen_mapper.py) after uncertain transitions
- Avoid repeated full hierarchy dumps (for example, repeated
describe-all) after every action
- Capture screenshots only when semantic data is not enough (visual QA, layout regressions, or bug report evidence).
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 once:
bash scripts/sim_health_check.sh
- Select/boot one simulator for the session (reuse same device/UDID)
- Launch app:
python scripts/app_launcher.py --launch com.example.app
- Analyze only as needed:
python scripts/screen_mapper.py
- Interact:
python scripts/navigator.py --find-text "Button" --tap
- Conditionally refresh/analyze after transitions (avoid repeated full dumps)
- Verify:
python scripts/accessibility_audit.py
- Capture screenshot/debug bundle only when 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---56# iOS Simulator Skill78Build, test, and automate iOS applications using accessibility-driven navigation and structured data instead of pixel coordinates.910## Quick Start1112```bash13# 1. Check environment14bash scripts/sim_health_check.sh1516# 2. Launch app17python scripts/app_launcher.py --launch com.example.app1819# 3. Map screen to see elements20python scripts/screen_mapper.py2122# 4. Tap button23python scripts/navigator.py --find-text "Login" --tap2425# 5. Enter text26python scripts/navigator.py --find-type TextField --enter-text "user@example.com"27```2829All scripts support `--help` for detailed options and `--json` for machine-readable output.3031## Navigation Strategy3233**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.3435For IDB-driven runs, optimize for warm-session reuse and minimal refreshes.3637Use this priority:381. `screen_mapper.py` → structured element list (5-7 lines, ~10 tokens)392. `navigator.py --find-text/--find-type/--find-id` → semantic interaction403. Screenshots → only for visual verification, bug reports, or visual diff4142Screenshots cost 1,600–6,300 tokens depending on size. The accessibility tree costs 10–50 tokens in default mode.4344## Fast IDB Workflow (Latency-Optimized)45461. **Pick one simulator per session** and keep using it (same UDID/device) unless the test explicitly requires a different device.472. **Reuse one warm IDB companion/session** across steps. Avoid reconnecting or restarting the companion between each command.483. **Use targeted actions first** (find/tap/type) and refresh state only when needed:49 - Run focused queries (`navigator.py` / `screen_mapper.py`) after uncertain transitions50 - Avoid repeated full hierarchy dumps (for example, repeated `describe-all`) after every action514. **Capture screenshots only when semantic data is not enough** (visual QA, layout regressions, or bug report evidence).5253## 21 Production Scripts5455### Build & Development (2 scripts)56571. **build_and_test.py** - Build Xcode projects, run tests, parse results with progressive disclosure58 - Build with live result streaming59 - Parse errors and warnings from xcresult bundles60 - Retrieve detailed build logs on demand61 - Options: `--project`, `--scheme`, `--clean`, `--test`, `--verbose`, `--json`62632. **log_monitor.py** - Real-time log monitoring with intelligent filtering64 - Stream logs or capture by duration65 - Filter by severity (error/warning/info/debug)66 - Deduplicate repeated messages67 - Options: `--app`, `--severity`, `--follow`, `--duration`, `--output`, `--json`6869### Navigation & Interaction (5 scripts)70713. **screen_mapper.py** - Analyze current screen and list interactive elements72 - Element type breakdown73 - Interactive button list74 - Text field status75 - Options: `--verbose`, `--hints`, `--json`76774. **navigator.py** - Find and interact with elements semantically78 - Find by text (fuzzy matching)79 - Find by element type80 - Find by accessibility ID81 - Enter text or tap elements82 - Options: `--find-text`, `--find-type`, `--find-id`, `--tap`, `--enter-text`, `--json`83845. **gesture.py** - Perform swipes, scrolls, pinches, and complex gestures85 - Directional swipes (up/down/left/right)86 - Multi-swipe scrolling87 - Pinch zoom88 - Long press89 - Pull to refresh90 - Options: `--swipe`, `--scroll`, `--pinch`, `--long-press`, `--refresh`, `--json`91926. **keyboard.py** - Text input and hardware button control93 - Type text (fast or slow)94 - Special keys (return, delete, tab, space, arrows)95 - Hardware buttons (home, lock, volume, screenshot)96 - Key combinations97 - Options: `--type`, `--key`, `--button`, `--slow`, `--clear`, `--dismiss`, `--json`98997. **app_launcher.py** - App lifecycle management100 - Launch apps by bundle ID101 - Terminate apps102 - Install/uninstall from .app bundles103 - Deep link navigation104 - List installed apps105 - Check app state106 - Options: `--launch`, `--terminate`, `--install`, `--uninstall`, `--open-url`, `--list`, `--state`, `--json`107108### Testing & Analysis (5 scripts)1091108. **accessibility_audit.py** - Check WCAG compliance on current screen111 - Critical issues (missing labels, empty buttons, no alt text)112 - Warnings (missing hints, small touch targets)113 - Info (missing IDs, deep nesting)114 - Options: `--verbose`, `--output`, `--json`1151169. **visual_diff.py** - Compare two screenshots for visual changes117 - Pixel-by-pixel comparison118 - Threshold-based pass/fail119 - Generate diff images120 - Options: `--threshold`, `--output`, `--details`, `--json`12112210. **test_recorder.py** - Automatically document test execution123 - Capture screenshots and accessibility trees per step124 - Generate markdown reports with timing data125 - Options: `--test-name`, `--output`, `--verbose`, `--json`12612711. **app_state_capture.py** - Create comprehensive debugging snapshots128 - Screenshot, UI hierarchy, app logs, device info129 - Markdown summary for bug reports130 - Options: `--app-bundle-id`, `--output`, `--log-lines`, `--json`13113212. **sim_health_check.sh** - Verify environment is properly configured133 - Check macOS, Xcode, simctl, IDB, Python134 - List available and booted simulators135 - Verify Python packages (Pillow)136137### Advanced Testing & Permissions (4 scripts)13813913. **clipboard.py** - Manage simulator clipboard for paste testing140 - Copy text to clipboard141 - Test paste flows without manual entry142 - Options: `--copy`, `--test-name`, `--expected`, `--json`14314414. **status_bar.py** - Override simulator status bar appearance145 - Presets: clean (9:41, 100% battery), testing (11:11, 50%), low-battery (20%), airplane (offline)146 - Custom time, network, battery, WiFi settings147 - Options: `--preset`, `--time`, `--data-network`, `--battery-level`, `--clear`, `--json`14814915. **push_notification.py** - Send simulated push notifications150 - Simple mode (title + body + badge)151 - Custom JSON payloads152 - Test notification handling and deep links153 - Options: `--bundle-id`, `--title`, `--body`, `--badge`, `--payload`, `--json`15415516. **privacy_manager.py** - Grant, revoke, and reset app permissions156 - 13 supported services (camera, microphone, location, contacts, photos, calendar, health, etc.)157 - Batch operations (comma-separated services)158 - Audit trail with test scenario tracking159 - Options: `--bundle-id`, `--grant`, `--revoke`, `--reset`, `--list`, `--json`160161### Device Lifecycle Management (5 scripts)16216317. **simctl_boot.py** - Boot simulators with optional readiness verification164 - Boot by UDID or device name165 - Wait for device ready with timeout166 - Batch boot operations (--all, --type)167 - Performance timing168 - Options: `--udid`, `--name`, `--wait-ready`, `--timeout`, `--all`, `--type`, `--json`16917018. **simctl_shutdown.py** - Gracefully shutdown simulators171 - Shutdown by UDID or device name172 - Optional verification of shutdown completion173 - Batch shutdown operations174 - Options: `--udid`, `--name`, `--verify`, `--timeout`, `--all`, `--type`, `--json`17517619. **simctl_create.py** - Create simulators dynamically177 - Create by device type and iOS version178 - List available device types and runtimes179 - Custom device naming180 - Returns UDID for CI/CD integration181 - Options: `--device`, `--runtime`, `--name`, `--list-devices`, `--list-runtimes`, `--json`18218320. **simctl_delete.py** - Permanently delete simulators184 - Delete by UDID or device name185 - Safety confirmation by default (skip with --yes)186 - Batch delete operations187 - Smart deletion (--old N to keep N per device type)188 - Options: `--udid`, `--name`, `--yes`, `--all`, `--type`, `--old`, `--json`18919021. **simctl_erase.py** - Factory reset simulators without deletion191 - Preserve device UUID (faster than delete+create)192 - Erase all, by type, or booted simulators193 - Optional verification194 - Options: `--udid`, `--name`, `--verify`, `--timeout`, `--all`, `--type`, `--booted`, `--json`195196## Common Patterns197198**Auto-UDID Detection**: Most scripts auto-detect the booted simulator if --udid is not provided.199200**Device Name Resolution**: Use device names (e.g., "iPhone 16 Pro") instead of UDIDs - scripts resolve automatically.201202**Batch Operations**: Many scripts support `--all` for all simulators or `--type iPhone` for device type filtering.203204**Output Formats**: Default is concise human-readable output. Use `--json` for machine-readable output in CI/CD.205206**Help**: All scripts support `--help` for detailed options and examples.207208**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`.209210## Typical Workflow2112121. Verify environment once: `bash scripts/sim_health_check.sh`2132. Select/boot one simulator for the session (reuse same device/UDID)2143. Launch app: `python scripts/app_launcher.py --launch com.example.app`2154. Analyze only as needed: `python scripts/screen_mapper.py`2165. Interact: `python scripts/navigator.py --find-text "Button" --tap`2176. Conditionally refresh/analyze after transitions (avoid repeated full dumps)2187. Verify: `python scripts/accessibility_audit.py`2198. Capture screenshot/debug bundle only when needed: `python scripts/app_state_capture.py --app-bundle-id com.example.app`220221## Requirements222223- macOS 12+224- Xcode Command Line Tools225- Python 3226- IDB (optional, for interactive features)227228## Documentation229230- **SKILL.md** (this file) - Script reference and quick start231- **README.md** - Installation and examples232- **CLAUDE.md** - Architecture and implementation details233- **references/** - Deep documentation on specific topics234- **examples/** - Complete automation workflows235236## Key Design Principles237238**Semantic Navigation**: Find elements by meaning (text, type, ID) not pixel coordinates. Survives UI changes.239240**Token Efficiency**: Concise default output (3-5 lines) with optional verbose and JSON modes for detailed results.241242**Accessibility-First**: Built on standard accessibility APIs for reliability and compatibility.243244**Zero Configuration**: Works immediately on any macOS with Xcode. No setup required.245246**Structured Data**: Scripts output JSON or formatted text, not raw logs. Easy to parse and integrate.247248**Auto-Learning**: Build system remembers your device preference. Configuration stored per-project.249250---251252Use these scripts directly or let Claude Code invoke them automatically when your request matches the skill description.