### Install Application on Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Installs an application bundle onto the booted simulator. This command produces no output on success. ```bash xcrun simctl install booted ``` -------------------------------- ### Launch, Install, and Manage iOS Apps Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Use this script to launch, install, list, restart, or check the state of applications on the iOS simulator. It supports installing from local .app bundles and opening deep links. ```bash python scripts/app_launcher.py --launch com.example.MyApp ``` ```bash python scripts/app_launcher.py --install /path/to/MyApp.app ``` ```bash python scripts/app_launcher.py --open-url "myapp://products/42" ``` ```bash python scripts/app_launcher.py --list ``` ```bash python scripts/app_launcher.py --restart com.example.MyApp ``` ```bash python scripts/app_launcher.py --state com.example.MyApp ``` -------------------------------- ### Install iOS Simulator Skill via Git Clone Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Clone the repository to install the skill. Choose the personal or project installation path based on your needs. Restart Claude Code after installation. ```bash # Personal installation git clone https://github.com/conorluddy/ios-simulator-skill.git ~/.claude/skills/ios-simulator-skill # Project installation git clone https://github.com/conorluddy/ios-simulator-skill.git .claude/skills/ios-simulator-skill ``` -------------------------------- ### List Installed Applications Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Fetches a list of all installed applications on the simulator, including their bundle IDs. Requires the simulator's UDID. ```bash idb list-apps --udid ``` -------------------------------- ### Common Simulator Workflow Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md A sequence of commands demonstrating a common workflow for testing applications on a simulator: booting a device, installing an app, launching it, and taking a screenshot. ```bash # Get booted device UDID xcrun simctl list devices | grep Booted # Quick app test xcrun simctl boot xcrun simctl install booted app.app xcrun simctl launch booted com.example.app xcrun simctl io booted screenshot test.png ``` -------------------------------- ### Batch Operations for Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/CLAUDE.md Provides examples of how to perform batch operations on simulators using command-line arguments like `--all` or `--type`. ```bash python scripts/simctl_boot.py --all python scripts/simctl_boot.py --type iPhone ``` -------------------------------- ### Download and Install Skill Package Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/DEV.md Use curl to download the latest release zip and unzip it into your Claude skills directory. Restart Claude Code after installation. ```bash # Download from releases curl -L https://github.com/YOUR_USERNAME/ios-simulator-skill/releases/latest/download/ios-simulator-skill-v1.0.0.zip -o skill.zip # Extract to Claude Code skills directory unzip skill.zip -d ~/.claude/skills/ios-simulator-skill # Restart Claude Code ``` -------------------------------- ### Boot iOS Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Start iOS simulators and verify their readiness. Use --name to target specific simulators, --wait-ready and --timeout for synchronization, or --all and --type to boot multiple. ```python simctl_boot.py ``` -------------------------------- ### Quick Start: iOS Simulator Skill Commands Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Execute these commands sequentially to check environment, launch an app, map the screen, and perform basic interactions like tapping and entering text. ```bash # 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" ``` -------------------------------- ### Development Workflow Example Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/DEV.md Illustrates a typical development cycle: making changes, committing with hooks, and pushing for a pull request. Hooks automatically run Black, Ruff, and mypy on commit. ```bash # Make changes to ios-simulator-skill/scripts/ vim ios-simulator-skill/scripts/build_and_test.py # Hooks run automatically on commit (Black, Ruff, mypy) git add ios-simulator-skill/scripts/build_and_test.py git commit -m "feat: improve build error reporting" # Push and create PR git push origin feature-branch # Open PR on GitHub - lint workflow runs automatically ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/DEV.md Clone the development repository and install necessary Python development dependencies using pip. Install pre-commit hooks for automated checks. ```bash # Clone repository git clone https://github.com/YOUR_USERNAME/ios-simulator-skill.git cd ios-simulator-skill # Install development dependencies pip3 install black ruff mypy pre-commit # Install pre-commit hooks pre-commit install # Verify setup pre-commit run --all-files ``` -------------------------------- ### Automate Multi-Device Testing on iOS Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Creates, boots, installs an app on, launches, screenshots, and deletes multiple iOS simulator devices based on a provided list of device names. Ensure `app.app` is the correct path to your application bundle. ```bash for device in "iPhone 15" "iPad Pro"; do udid=$(xcrun simctl create test-$device "$device") xcrun simctl boot $udid xcrun simctl install $udid app.app xcrun simctl launch $udid com.example.app xcrun simctl io $udid screenshot $device.png xcrun simctl delete $udid done ``` -------------------------------- ### Output Formatting Examples Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/CLAUDE.md Shows different output formats for script results, including default, verbose, and JSON, to cater to various use cases and debugging needs. ```text # Default (3-5 lines) Device booted: iPhone 16 Pro (ABC123) [2.1s] # --verbose (50+ lines) Device booted successfully. Device UDID: ABC123DEF456... Boot time: 2.1 seconds # --json (20-30 lines) {"action": "boot", "udid": "ABC123", "success": true} ``` -------------------------------- ### Install iOS Simulator Skill via Plugin Marketplace Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Use this command to add the skill directly from the plugin marketplace within Claude Code. Ensure Claude Code is running. ```bash /plugin marketplace add conorluddy/ios-simulator-skill /plugin install ios-simulator-skill@conorluddy ``` -------------------------------- ### Manage App Lifecycle with app_launcher.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Handles iOS application lifecycle events including launching, terminating, installing, uninstalling, and deep-linking. It can also list installed applications and check their running state. The script auto-detects the booted simulator if no UDID is specified. -------------------------------- ### Get App Container Path Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Retrieves the file system path to an application's data container on the booted simulator. Specify 'data' to get the path to the data directory. ```bash xcrun simctl get_app_container booted data ``` -------------------------------- ### Stream Simulator Logs Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Streams live log output from a specified application process on the booted simulator. Use a predicate to filter logs, for example, by process name. ```bash xcrun simctl spawn booted log stream --predicate 'process == ""' ``` -------------------------------- ### Submit Form with Tap Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Combines text input with a tap action to simulate form submission. This example taps a 'Submit' button after entering text. ```bash idb ui tap 200 500 # Submit button ``` -------------------------------- ### Manage iOS Application Lifecycle Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Launch, terminate, install, or uninstall iOS applications. Also supports deep linking and checking app state. ```python # Example: Launch an app python scripts/app_launcher.py --launch "com.apple.Maps" # Example: Terminate an app python scripts/app_launcher.py --terminate "com.example.app" # Example: Install an app from a bundle python scripts/app_launcher.py --install "/path/to/MyApp.app" ``` -------------------------------- ### Describe UI Accessibility Tree Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Use to get the complete accessibility tree of the UI. Redirect output to a file for later analysis. ```bash # Get accessibility tree idb ui describe-all --json --nested > tree.json ``` -------------------------------- ### Test Scripts Locally Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/DEV.md Instructions for testing scripts locally. Ensure the iOS Simulator is booted before running health checks or individual scripts. Includes steps for testing skill installation. ```bash # Test scripts locally with booted simulator open -a Simulator # Run health check bash ios-simulator-skill/scripts/sim_health_check.sh # Test individual scripts python ios-simulator-skill/scripts/build_and_test.py --help python ios-simulator-skill/scripts/screen_mapper.py # Test skill installation mkdir -p ~/.claude/skills/ios-simulator-skill-test cp -r ios-simulator-skill/* ~/.claude/skills/ios-simulator-skill-test/ # Restart Claude Code and verify ``` -------------------------------- ### Install Pillow for Visual Diff Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when Python encounters a 'module not found' error for Pillow, typically during visual diff operations. ```bash pip3 install pillow ``` -------------------------------- ### Model Inspector JSON Output Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Example of generating JSON output from the model inspector script. ```bash python scripts/model_inspector.py --project-path . --json ``` -------------------------------- ### Analyze Current Screen Elements Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Map the current simulator screen to get a structured list of interactive elements, including types, labels, and states. Useful for understanding the UI before interaction. ```python # Example usage: python scripts/screen_mapper.py --verbose --json ``` -------------------------------- ### Run Claude Code Evals with iOS Simulator Skill Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Execute Claude Code evaluations using a specific skill. Ensure the skill is installed and accessible in your environment. ```bash claude evals run evals/evals.json --skill ios-simulator-skill ``` -------------------------------- ### Boot Simulators by Name or Type with simctl_boot.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Boots simulators using their UDID or name. Supports waiting for the simulator to be ready, setting timeouts, and batch operations like booting all simulators of a specific type. Outputs timing information and can provide JSON for CI/CD. ```bash python scripts/simctl_boot.py --name "iPhone 16 Pro" --wait-ready --timeout 120 ``` ```bash python scripts/simctl_boot.py --type iPhone ``` ```bash python scripts/simctl_boot.py --name "iPhone 16 Pro" --wait-ready --json ``` -------------------------------- ### Create iOS Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Provision new iOS simulators based on device type and OS version. Use --device and --runtime to specify the configuration. Use --list-devices to see available options. ```python simctl_create.py ``` -------------------------------- ### List Simulator Devices Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Lists all available simulator devices along with their unique identifiers (UDIDs) and current states. Use 'booted' as a UDID to refer to the currently running simulator. ```bash xcrun simctl list devices ``` -------------------------------- ### Record Video from Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Records video of the booted simulator's screen and saves it to a specified file. Press Ctrl+C to stop recording. The default codec is HEVC, but can be changed using the --codec option. ```bash xcrun simctl io booted recordVideo ``` -------------------------------- ### Xcode Build Summary and Detail Retrieval Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md The `build_and_test.py` script provides a concise build summary. Use the xcresult ID to progressively retrieve errors, warnings, or the full log. ```bash Build: SUCCESS (0 errors, 3 warnings) [xcresult-20251018-143052] ``` ```bash python scripts/build_and_test.py --get-errors xcresult-20251018-143052 python scripts/build_and_test.py --get-warnings xcresult-20251018-143052 python scripts/build_and_test.py --get-log xcresult-20251018-143052 ``` -------------------------------- ### Quick Diagnostics for Simulator and IDB Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md A collection of commands for quickly diagnosing the state of the simulator and IDB connections, and testing basic interaction. ```bash # Check simulator state xcrun simctl list devices | grep Booted ``` ```bash # Verify IDB connection idb list-targets ``` ```bash # Test basic interaction xcrun simctl io booted screenshot test.png ``` -------------------------------- ### AI-Agent Driven App Testing Workflow Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Illustrates a typical AI-agent-driven app testing workflow using various scripts for booting simulators, launching apps, and navigating the accessibility tree. ```text simctl_boot.py app_launcher.py screen_mapper.py navigator.py accessibility_audit.py app_state_capture.py ``` -------------------------------- ### Boot Simulator Device Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Boots a specific simulator device using its UDID. This command typically produces no output on success. ```bash xcrun simctl boot ``` -------------------------------- ### Establish Performance Baseline with Screenshots Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Captures screenshots before and after launching an application to establish a performance baseline, then compares them using a visual diff script. Assumes `visual_diff.py` is available. ```bash # Capture initial state xcrun simctl io booted screenshot perf-before.png # Run performance test xcrun simctl launch booted com.example.app sleep 5 xcrun simctl io booted screenshot perf-after.png python scripts/visual_diff.py perf-before.png perf-after.png ``` -------------------------------- ### Capture App State with Quarter-Size Screenshot Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Capture the application state using a quarter-size screenshot, suitable for quick visual checks and further reducing data size. ```bash python scripts/app_state_capture.py --size quarter ``` -------------------------------- ### CI/CD Pipeline Integration Workflow Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Demonstrates a CI/CD pipeline integration workflow using scripts for simulator provisioning, building, testing, and cleanup, with JSON output for parsing. ```text simctl_create.py build_and_test.py simctl_delete.py privacy_manager.py status_bar.py push_notification.py visual_diff.py ``` -------------------------------- ### Open Simulator or Boot Device Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when encountering the 'No booted devices' error. This opens the Simulator application or boots a specific device. ```bash open -a Simulator ``` ```bash xcrun simctl boot ``` -------------------------------- ### Launch Application on Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Launches a specified application on the booted simulator. The command returns the process ID (PID) of the launched application. ```bash xcrun simctl launch booted ``` -------------------------------- ### List Available Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Retrieves a list of all available simulators along with their unique device identifiers (UDIDs). ```bash idb list-targets ``` -------------------------------- ### Capture Screenshot from Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/simctl_quick.md Captures a screenshot of the booted simulator and saves it to a specified file. The default format is PNG, but can be changed using the --type option. ```bash xcrun simctl io booted screenshot ``` -------------------------------- ### Run Smoke Test on iOS Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Boots a simulator, launches an app, performs an accessibility audit, and takes a screenshot. Requires simulator UDID and app bundle ID. ```bash xcrun simctl boot xcrun simctl launch booted python scripts/accessibility_audit.py xcrun simctl io booted screenshot smoke.png ``` -------------------------------- ### Create New Simulators with simctl_create.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Creates new iOS simulators based on device type and runtime version. Useful for dynamic provisioning in CI/CD pipelines. Returns the UDID of the newly created device, which can be used for subsequent operations. Includes an option to list available device types. ```bash python scripts/simctl_create.py --list-devices ``` ```bash python scripts/simctl_create.py --device "iPhone 16 Pro" --runtime "18.0" --name "CI-iPhone-16" ``` ```bash python scripts/simctl_create.py --device "iPhone 16 Pro" --runtime "18.0" --json ``` -------------------------------- ### Terminate and Relaunch App Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when an app won't launch. This command terminates the specified app and then relaunches it. ```bash xcrun simctl terminate booted && xcrun simctl launch booted ``` -------------------------------- ### Launch App with app_launcher.py Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Use this Python script to launch a specific application on the simulator. Requires the app's bundle ID. ```python python scripts/app_launcher.py --launch com.example.app ``` -------------------------------- ### Perform UI Tap Action Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Simulates a tap at specific X and Y coordinates on the screen. No output is returned on success. ```bash idb ui tap 200 400 ``` -------------------------------- ### Capture App State with Half-Size Screenshot Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Capture the application state using a half-size screenshot for reduced data usage and faster processing. This is the default behavior. ```bash python scripts/app_state_capture.py --size half ``` -------------------------------- ### Robust Simulator Navigation with Accessibility Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Interact with simulator elements using accessibility APIs for robustness against UI changes, unlike fragile coordinate-based tapping. ```bash # Fragile — breaks if UI changes idb ui tap 320 400 # Robust — finds by meaning python scripts/navigator.py --find-text "Login" --tap ``` -------------------------------- ### Build Xcode Projects and Run Tests Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Automates Xcode builds and test execution with options for specifying projects, schemes, and retrieving detailed results from xcresult bundles. Use --get-errors or --get-all for detailed failure analysis. ```bash # Build project (auto-detects .xcodeproj in current directory) python scripts/build_and_test.py ``` ```bash # Specify project and scheme python scripts/build_and_test.py --project MyApp.xcodeproj --scheme MyApp ``` ```bash # Run tests python scripts/build_and_test.py --project MyApp.xcodeproj --test ``` ```bash # Drill into errors from a failed build python scripts/build_and_test.py --get-errors xcresult-20251018-143052 ``` ```bash # Get all details as JSON python scripts/build_and_test.py --get-all xcresult-20251018-143052 --json ``` ```bash # List recent xcresult bundles python scripts/build_and_test.py --list-xcresults ``` -------------------------------- ### Capture Application State for Debugging Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Create debugging snapshots including screenshots, hierarchy, and logs. Requires the application bundle ID via --app-bundle-id and specifies output with --output. Control log lines with --log-lines. ```python app_state_capture.py ``` -------------------------------- ### Record Test Execution with Documentation Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Records test execution step-by-step, capturing screenshots and accessibility trees to generate a markdown report. Supports verbose output and JSON for programmatic processing. ```bash python scripts/test_recorder.py --test-name "login-flow" --output test-reports/ ``` ```bash python scripts/test_recorder.py --test-name "checkout-flow" --verbose ``` ```bash python scripts/test_recorder.py --test-name "onboarding" --json ``` -------------------------------- ### Perform UI Swipe Action Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Simulates a swipe gesture between two sets of coordinates (x1, y1) and (x2, y2) on the screen. No output is returned on success. ```bash idb ui swipe ``` -------------------------------- ### Record Login Flow with TestRecorder Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Uses the `TestRecorder` class from `scripts.test_recorder` to script a login flow, logging each step. Uncomment `idb` commands to enable actual interaction. ```python from scripts.test_recorder import TestRecorder rec = TestRecorder("Login Test") rec.step("Launch app") # idb ui tap 200 400 # Login button rec.step("Enter credentials") # idb ui text "user@example.com" rec.step("Submit") # idb ui tap 200 500 rec.generate_report() ``` -------------------------------- ### Verify Environment with sim_health_check.sh Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Run this script to verify your simulator environment. It's the first step in the typical workflow. ```bash bash scripts/sim_health_check.sh ``` -------------------------------- ### Create a GitHub Release Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/DEV.md Steps to create a new release: update version in pyproject.toml, commit, tag, and push. A GitHub release is then created manually, triggering automated packaging and validation via GitHub Actions. ```bash # 1. Update version in pyproject.toml vim pyproject.toml # Update version = "1.1.0" # 2. Commit version bump git add pyproject.toml git commit -m "chore: bump version to 1.1.0" git push origin main # 3. Create and push tag git tag v1.1.0 git push origin v1.1.0 # 4. Create GitHub release # Go to: https://github.com/YOUR_USERNAME/ios-simulator-skill/releases/new # - Tag: v1.1.0 # - Title: "Release v1.1.0" # - Description: (auto-generated or write your own) # - Publish release # 5. GitHub Actions automatically: # - Validates version consistency # - Packages skill/ directory # - Attaches ios-simulator-skill-v1.1.0.zip to release ``` -------------------------------- ### Ensure Simulator is Booted for Screenshots Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when screenshot attempts fail. This command ensures the specified simulator is booted before proceeding. ```bash xcrun simctl boot ``` -------------------------------- ### Take Screenshot of Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Captures a screenshot of the specified simulator and saves it to a file. Requires the simulator's UDID. ```bash idb screenshot --udid output.png ``` -------------------------------- ### Run Accessibility Audit Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/accessibility_checklist.md Execute the accessibility audit script from the command line. ```bash python scripts/accessibility_audit.py ``` -------------------------------- ### Show All Model Versions Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Display all available model versions for Core Data or SwiftData models within a project. Useful for understanding migration history. ```bash python scripts/model_inspector.py --project-path . --show-versions ``` -------------------------------- ### Describe Element at Point Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Retrieves detailed information about the UI element located at the specified X and Y coordinates. Use the --json flag for structured output. ```bash idb ui describe-point --json ``` -------------------------------- ### Build and Test Xcode Projects Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Use this script to build Xcode projects, run tests, and parse build results. Supports live result streaming and detailed log retrieval. ```python # Example usage (options not shown): # python scripts/build_and_test.py --project "MyApp.xcodeproj" --scheme "MyApp" --test ``` -------------------------------- ### Class-Based Script Design in Python Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/CLAUDE.md Illustrates the class-based architecture for scripts, including initialization and execution methods. Supports standard argument parsing for UDID. ```python class DeviceManager: def __init__(self, udid: str | None = None): self.udid = udid def execute(self, **kwargs) -> tuple[bool, str]: # Return (success, message) tuple pass def main(): parser = argparse.ArgumentParser() manager = DeviceManager(args.udid) success, message = manager.execute() print(message) sys.exit(0 if success else 1) ``` -------------------------------- ### Capture App State in Inline Base64 Mode Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Capture the application state with the screenshot encoded as a Base64 string directly in the output. This mode is useful for vision-based agents. ```bash python scripts/app_state_capture.py --inline ``` -------------------------------- ### Document Automated Tests with Screenshots Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Generate automated test documentation by capturing screenshots. Specify the test name with --test-name and the output file with --output. ```python test_recorder.py ``` -------------------------------- ### Interact with UI Elements using navigator.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt This script enables interaction with UI elements based on their text, type, or accessibility ID, avoiding fragile pixel coordinates. It can find elements, enter text, and list tappable items. ```bash python scripts/navigator.py --find-text "Login" --tap ``` ```bash python scripts/navigator.py --find-type TextField --enter-text "user@example.com" ``` ```bash python scripts/navigator.py --find-id "submitButton" --tap ``` ```bash python scripts/navigator.py --find-text "Next" --index 1 --tap ``` ```bash python scripts/navigator.py --list ``` ```bash python scripts/navigator.py --tap-at 160,225 --screenshot-coords \ --screenshot-width 390 --screenshot-height 844 ``` -------------------------------- ### Input Text into UI Element Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/idb_quick.md Types the specified text into the active UI element. Ensure the target element is ready to receive input. ```bash idb ui text "username@example.com" ``` -------------------------------- ### Run Linters Manually Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/DEV.md Commands to manually run Black for formatting, Ruff for linting (with auto-fix), and mypy for type checking. `pre-commit run --all-files` executes all configured checks. ```bash # Format code black ios-simulator-skill/scripts/ # Lint code (with auto-fix) ruff check --fix ios-simulator-skill/scripts/ # Type check mypy ios-simulator-skill/scripts/ # Or run all checks pre-commit run --all-files ``` -------------------------------- ### Auto-UDID Detection Logic Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/CLAUDE.md Demonstrates how to resolve device identifiers, supporting optional UDID arguments and handling potential runtime errors during resolution. ```python try: udid = resolve_device_identifier(args.udid) # May be None except RuntimeError as e: print(f"Error: {e}", file=sys.stderr) sys.exit(1) ``` -------------------------------- ### Inspect Core Data / SwiftData Models Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Examine Core Data or SwiftData models from project files. Specify the project path with --project-path. Use --raw for raw output and --show-versions to display version information. ```python model_inspector.py ``` -------------------------------- ### Capture App Debugging Snapshots Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Creates comprehensive debugging snapshots including screenshots, accessibility trees, logs, and device info. Snapshots are saved in a timestamped directory with a markdown summary. ```bash # Capture full state to current directory python scripts/app_state_capture.py --app-bundle-id com.example.MyApp ``` -------------------------------- ### Manage Application Permissions Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Grant, revoke, or reset permissions for up to 13 services for a given application. Specify the app using --bundle-id and the action with --grant, --revoke, or --reset. ```python privacy_manager.py ``` -------------------------------- ### Copy Text to Simulator Clipboard Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Place text into the simulator's clipboard for paste testing. Use --copy to specify the text and --test-name for context. ```python clipboard.py ``` -------------------------------- ### Interact with navigator.py Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Use this script to interact with UI elements on the simulator, such as tapping buttons found by their text. It supports finding elements by text and performing actions like tapping. ```python python scripts/navigator.py --find-text "Button" --tap ``` -------------------------------- ### Compare Screenshots for Visual Regressions Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Compares two screenshots pixel-by-pixel to detect visual regressions. Requires Pillow. Use --threshold to adjust sensitivity and --output to specify artifact directory. ```bash # Compare baseline to current screenshot (1% threshold) python scripts/visual_diff.py baseline.png current.png ``` ```bash # Stricter threshold for pixel-perfect testing python scripts/visual_diff.py baseline.png current.png --threshold 0.001 ``` ```bash # Save diff artifacts to custom directory python scripts/visual_diff.py baseline.png current.png --output test-artifacts/ ``` ```bash # Detailed JSON report python scripts/visual_diff.py baseline.png current.png --details ``` -------------------------------- ### Analyze Screen with screen_mapper.py Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md This script analyzes the current screen of the simulator. It's part of the typical workflow for understanding the UI state. ```python python scripts/screen_mapper.py ``` -------------------------------- ### Perform Accessibility Audit Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Check WCAG compliance of the current simulator screen. Use --verbose for detailed output and --output to specify a file path. ```python accessibility_audit.py ``` -------------------------------- ### Monitor Simulator Logs Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Streams simulator logs in real-time with filtering by severity and time. Supports continuous following, duration-based capture, and output to file or JSON. ```bash # Follow app logs in real-time (Ctrl+C to stop) python scripts/log_monitor.py --app com.example.MyApp --follow ``` ```bash # Capture 30 seconds of logs then summarize python scripts/log_monitor.py --app com.example.MyApp --duration 30s ``` ```bash # Show only errors/warnings from the last 5 minutes python scripts/log_monitor.py --severity error,warning --last 5m ``` ```bash # Save logs to directory with JSON summary python scripts/log_monitor.py --app com.example.MyApp --duration 1m --output logs/ ``` ```bash # JSON output for programmatic use python scripts/log_monitor.py --app com.example.MyApp --duration 10s --json ``` -------------------------------- ### Control Keyboard Input and Hardware Buttons Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Simulate text input, special key presses, and hardware button actions (like home, lock, volume) for the iOS simulator. ```python # Example: Type text slowly python scripts/keyboard.py --type "Hello World" --slow # Example: Press the home button python scripts/keyboard.py --button "home" ``` -------------------------------- ### Perform Visual Regression Test on iOS Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Captures a baseline screenshot and a current screenshot of the simulator's display, then uses a Python script to compare them. Ensure `visual_diff.py` is available. ```bash # Baseline xcrun simctl io booted screenshot baseline.png # After changes xcrun simctl io booted screenshot current.png python scripts/visual_diff.py baseline.png current.png ``` -------------------------------- ### Capture App State with Custom Output and Log Depth Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Capture the current state of an iOS application, including screenshots and logs. Customize the output directory and the number of log lines to capture. ```bash python scripts/app_state_capture.py --app-bundle-id com.example.MyApp \ --output debug-snapshots/ --log-lines 200 ``` -------------------------------- ### Compare Screenshots for Visual Differences Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Identify visual changes between two screenshots. Adjust the --threshold for sensitivity and use --output or --details for more information. ```python visual_diff.py ``` -------------------------------- ### Factory Reset iOS Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Perform a factory reset on simulators without deleting them. Use --name for specific simulators, --all to target multiple. Use --verify to confirm the reset and --booted to reset only running simulators. ```python simctl_erase.py ``` -------------------------------- ### Analyze iOS Screen Content with screen_mapper.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt This script analyzes the iOS accessibility tree to provide a concise summary of visible and interactive elements on the screen. Use --verbose for more details or --json for programmatic processing. ```bash python scripts/screen_mapper.py ``` ```bash python scripts/screen_mapper.py --verbose ``` ```bash python scripts/screen_mapper.py --hints ``` ```bash python scripts/screen_mapper.py --json ``` -------------------------------- ### Verify iOS Simulator Environment Health Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Check the health and readiness of the simulator environment, including Xcode, simctl, IDB, and Python. ```bash sim_health_check.sh ``` -------------------------------- ### Capture App State with app_state_capture.py Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md This script captures the state of an application, useful for debugging. It requires the app's bundle ID and defaults to capturing screenshots in 'half' size. ```python python scripts/app_state_capture.py --app-bundle-id com.example.app ``` -------------------------------- ### Capture App State for Bug Report Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Uses a Python script to capture the current state of a specified application for debugging purposes. Requires the app's bundle ID and an output directory. ```bash python scripts/app_state_capture.py \ --app-bundle-id com.example.app \ --output bug-report/ ``` -------------------------------- ### Stream Logs with Process Filter Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when logs are not showing. Specify the correct app name in the predicate to filter logs for a specific process. ```bash xcrun simctl spawn booted log stream --predicate 'process == "AppName"' ``` -------------------------------- ### Simulate Keyboard and Hardware Button Presses Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt This script handles text entry, special key presses (like Return and Delete), and hardware button simulations (Home, Lock, Volume) on the iOS simulator. It supports slow typing for animation-sensitive UIs. ```bash python scripts/keyboard.py --type "hello@example.com" ``` ```bash python scripts/keyboard.py --key return ``` ```bash python scripts/keyboard.py --key delete --count 3 ``` ```bash python scripts/keyboard.py --button home ``` ```bash python scripts/keyboard.py --type "slow text" --slow ``` ```bash python scripts/keyboard.py --clear ``` -------------------------------- ### Conduct Full Accessibility Audit per Screen Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/test_patterns.md Iterates through a list of screens, performing an accessibility audit for each and saving the report to a JSON file. Requires `accessibility_audit.py` script. ```bash # Each screen for screen in home login settings; do # Navigate to screen (app-specific) python scripts/accessibility_audit.py --output $screen.json done ``` -------------------------------- ### Navigate and Interact with UI Elements Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Semantically find and interact with UI elements by text, type, or accessibility ID. Supports tapping and entering text. ```python # Find and tap a button by text: python scripts/navigator.py --find-text "Submit" --tap # Enter text into a text field by type: python scripts/navigator.py --find-type "SecureTextField" --enter-text "password123" ``` -------------------------------- ### Shutdown Simulators with simctl_shutdown.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Gracefully shuts down one or all simulators. Supports optional verification to confirm the shutdown process completed successfully. Can target specific simulator types or all simulators using batch options. ```bash python scripts/simctl_shutdown.py --name "iPhone 16 Pro" --verify ``` ```bash python scripts/simctl_shutdown.py --type iPad ``` -------------------------------- ### Copy Text to Simulator Clipboard Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Copies text to the simulator clipboard for testing paste functionality. Useful for avoiding manual typing of long strings. ```bash python scripts/clipboard.py --copy "test@example.com" ``` ```bash python scripts/clipboard.py --copy "Tr0ub4dor&3" --test-name "password-paste-test" ``` -------------------------------- ### Perform Gestures with gesture.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt This script allows for various gestures on the iOS simulator, including swipes, scrolling, pinch-to-zoom, long-press, and pull-to-refresh. It auto-detects screen dimensions. ```bash python scripts/gesture.py --swipe up ``` ```bash python scripts/gesture.py --scroll down --scroll-amount 5 ``` ```bash python scripts/gesture.py --refresh ``` ```bash python scripts/gesture.py --pinch out ``` ```bash python scripts/gesture.py --long-press 200,300 --duration 1.5 ``` ```bash python scripts/gesture.py --swipe-from 300,600 --swipe-to 100,600 ``` -------------------------------- ### Set Accessibility Hint Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/accessibility_checklist.md Provide an accessibility hint for controls like sliders to explain the action performed when the control is activated. ```swift slider.accessibilityHint = "Adjusts volume" ``` -------------------------------- ### Erase Device for Full Storage Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when device storage is full. Warning: This action deletes all data on the device. ```bash xcrun simctl erase ``` -------------------------------- ### Factory Reset Simulators with simctl_erase.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Erases simulator content and settings, effectively performing a factory reset without deleting the device itself, thus preserving its UUID. This is faster than deleting and recreating a simulator. Supports erasing all, by type, or only currently booted simulators. ```bash python scripts/simctl_erase.py --name "iPhone 16 Pro" ``` ```bash python scripts/simctl_erase.py --booted ``` ```bash python scripts/simctl_erase.py --type iPhone --verify ``` -------------------------------- ### Restart Simulator and Erase Device Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when the simulator won't boot. This command terminates all simulator processes and erases the specified device. ```bash killall Simulator && xcrun simctl erase ``` -------------------------------- ### Send Push Notification by Loading Payload from File Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Send a push notification by loading a custom JSON payload from a specified file. This is useful for managing complex notification payloads. ```bash python scripts/push_notification.py \ --bundle-id com.example.MyApp \ --payload ./test-notifications/order-shipped.json ``` -------------------------------- ### Restart IDB and Companion Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when IDB is not connecting. This command stops the IDB daemon and restarts the companion service. ```bash idb kill && idb companion --boot-status-check ``` -------------------------------- ### Make Scripts Executable Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/references/troubleshooting.md Use when encountering 'Permission denied' errors for shell scripts. This command grants execute permissions to all .sh files in the scripts directory. ```bash chmod +x scripts/*.sh ``` -------------------------------- ### Inspect Project Data Models Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Inspect Core Data or SwiftData models within a project. This script analyzes `.xcdatamodeld` packages or `@Model` classes to report entities, attributes, and relationships. ```bash python scripts/model_inspector.py --project-path /path/to/MyApp.xcodeproj ``` -------------------------------- ### Shutdown iOS Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Gracefully shut down iOS simulators. Use --name for specific simulators, --verify to confirm shutdown, or --all and --type to target multiple. ```python simctl_shutdown.py ``` -------------------------------- ### Monitor iOS Logs in Real-time Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Stream or capture logs from an iOS app with intelligent filtering by severity, deduplication, and duration. ```python # Example usage (options not shown): # python scripts/log_monitor.py --app "com.example.app" --severity "error" --follow ``` -------------------------------- ### Delete Simulators with simctl_delete.py Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Permanently deletes specified simulators. Use the `--yes` flag to bypass the safety confirmation prompt. Supports deleting all simulators of a certain type or retaining only the N newest simulators per device type using the `--old N` option. ```bash python scripts/simctl_delete.py --name "CI-iPhone-16" ``` ```bash python scripts/simctl_delete.py --name "CI-iPhone-16" --yes ``` ```bash python scripts/simctl_delete.py --old 2 --yes ``` -------------------------------- ### Delete iOS Simulators Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Remove iOS simulators. Use --name for specific simulators, --all and --old to remove multiple or older versions. Use --yes to bypass confirmation. ```python simctl_delete.py ``` -------------------------------- ### Perform Gestures on the Simulator Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/ios-simulator-skill/skills/ios-simulator-skill/SKILL.md Execute various gestures like swipes, scrolls, pinches, long presses, and pull-to-refresh actions on the iOS simulator. ```python # Example: Swipe up python scripts/gesture.py --swipe "up" # Example: Pinch zoom python scripts/gesture.py --pinch "0.5" ``` -------------------------------- ### Dismiss Keyboard Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Use this script to dismiss the on-screen keyboard in the iOS simulator. ```bash python scripts/keyboard.py --dismiss ``` -------------------------------- ### Apply Custom Status Bar Override Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Manually override the simulator status bar by specifying custom values for time, battery level, and data network type. ```bash python scripts/status_bar.py --time "10:30" --battery-level 75 --data-network 4g ``` -------------------------------- ### Send Simulated Push Notifications Source: https://github.com/conorluddy/ios-simulator-skill/blob/main/README.md Trigger simulated push notifications to an application. Requires the bundle ID via --bundle-id and notification content via --title, --body, and --payload. ```python push_notification.py ``` -------------------------------- ### Send Simple Push Notification Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Send a basic APNS push notification to the iOS simulator with a title, body, and badge count. Useful for testing basic notification handling. ```bash python scripts/push_notification.py \ --bundle-id com.example.MyApp \ --title "Order Update" \ --body "Your order has shipped!" \ --badge 3 ``` -------------------------------- ### Restore Default Status Bar Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Clear any custom status bar overrides and restore the simulator to its default status bar configuration. ```bash python scripts/status_bar.py --clear ``` -------------------------------- ### Apply Status Bar Preset Source: https://context7.com/conorluddy/ios-simulator-skill/llms.txt Override the iOS simulator status bar using predefined presets for common testing scenarios like App Store screenshots or low battery warnings. ```bash python scripts/status_bar.py --preset clean ``` ```bash python scripts/status_bar.py --preset low_battery ``` ```bash python scripts/status_bar.py --preset airplane ```