Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dpearson2699 avatar

Ios Simulator

  • 1.8k installs
  • 944 repo stars
  • Updated July 15, 2026
  • dpearson2699/swift-ios-skills

ios-simulator is an agent skill that manages ios simulator devices and tests app behavior using xcrun simctl. covers device lifecycle (create, boot, shutdown, erase, delete), app install and launch, push notification sim

About

ios-simulator is an agent skill from dpearson2699/swift-ios-skills that manages ios simulator devices and tests app behavior using xcrun simctl. covers device lifecycle (create, boot, shutdown, erase, delete), app install and launch, push notification simulation, location. # iOS Simulator Manage iOS Simulator devices and test app behavior from the command line using `xcrun simctl`. Covers the full device lifecycle, app deployment, push and location simulation, permission control, screenshot and video recording, log streaming, and compile-time simulator detection. For common subcommands, syntax, and examples, see [r Developers invoke ios-simulator during ship/testing work for testing & qa tasks. The skill documents triggers, prerequisites, and step-by-step workflows grounded in SKILL.md. Compatible with Claude Code, Cursor, and Codex agent runtimes that load marketplace skills. Review the Security Audits panel on this listing before installing in production environments.

  • For common subcommands, syntax, and examples, see [references/simctl-commands.md](references/simctl-commands.md).
  • [Device Lifecycle](#device-lifecycle)
  • [App Install and Launch](#app-install-and-launch)
  • [Testing Workflows](#testing-workflows)
  • [Screenshot and Video Recording](#screenshot-and-video-recording)

Ios Simulator by the numbers

  • 1,752 all-time installs (skills.sh)
  • +133 installs in the week ending Jul 29, 2026 (Skillselion tracking)
  • Ranked #415 of 2,159 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
At a glance

ios-simulator capabilities & compatibility

Capabilities
for common subcommands, syntax, and examples, se · [device lifecycle](#device lifecycle) · [app install and launch](#app install and launch · [testing workflows](#testing workflows) · [screenshot and video recording](#screenshot and
Use cases
orchestration
From the docs

What ios-simulator says it does

For common subcommands, syntax, and examples, see [references/simctl-commands.md](references/simctl-commands.md).
SKILL.md
- [App Install and Launch](#app-install-and-launch)
SKILL.md
- [Testing Workflows](#testing-workflows)
SKILL.md
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill ios-simulator

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.8k
repo stars944
Security audit3 / 3 scanners passed
Last updatedJuly 15, 2026
Repositorydpearson2699/swift-ios-skills

What it does

Manages iOS Simulator devices and tests app behavior using xcrun simctl. Covers device lifecycle (create, boot, shutdown, erase, delete), app install and launch, push notification simulation, location

Who is it for?

Developers working on testing & qa during ship tasks.

Skip if: Tasks outside Testing & QA scope described in SKILL.md.

When should I use this skill?

Manages iOS Simulator devices and tests app behavior using xcrun simctl. Covers device lifecycle (create, boot, shutdown, erase, delete), app install and launch, push notification simulation, location

What you get

Completed testing & qa workflow aligned with SKILL.md steps.

  • simctl test script
  • automated location route run

By the numbers

  • Uses simctl location start for waypoint-based routes without GPX

Files

SKILL.mdMarkdownGitHub ↗

iOS Simulator

Manage iOS Simulator devices and test app behavior from the command line using xcrun simctl. Covers the full device lifecycle, app deployment, push and location simulation, permission control, screenshot and video recording, log streaming, and compile-time simulator detection.

For common subcommands, syntax, and examples, see references/simctl-commands.md.

Contents

Device Lifecycle

Listing Devices and Runtimes

# List all available simulators grouped by runtime
xcrun simctl list devices available

# List installed runtimes
xcrun simctl list runtimes

# List only booted devices
xcrun simctl list devices booted

# JSON output for scripting
xcrun simctl list -j devices available

Parse JSON output to find a specific device programmatically. See references/simctl-commands.md for jq parsing examples.

Creating a Device

# Find available device types and runtimes
xcrun simctl list devicetypes
xcrun simctl list runtimes

# Create a device — returns the new UDID
xcrun simctl create "My Test Phone" "iPhone 16 Pro" "com.apple.CoreSimulator.SimRuntime.iOS-18-4"

Device types and runtime identifiers in examples throughout this skill are illustrative. Run simctl list devicetypes and simctl list runtimes to find the identifiers available on your system.

The returned UDID identifies the device for all subsequent commands. Use descriptive names to distinguish devices in simctl list output.

Boot, Shutdown, Erase, Delete

# Boot a specific device
xcrun simctl boot <UDID>

# Boot if needed and wait until the device is ready
xcrun simctl bootstatus <UDID> -b

# Shutdown a running device
xcrun simctl shutdown <UDID>

# Factory reset — wipes all data, keeps the device
xcrun simctl erase <UDID>

# Delete a specific device
xcrun simctl delete <UDID>

# Delete all devices not available in the current Xcode
xcrun simctl delete unavailable

# Shutdown everything
xcrun simctl shutdown all

Use booted as a UDID shorthand when exactly one simulator is running:

xcrun simctl shutdown booted

If multiple simulators are booted, booted picks one of them non-deterministically. Prefer explicit UDIDs when running parallel simulators.

In scripts and CI, use xcrun simctl bootstatus <UDID> -b before install, launch, push, or location commands. If you call simctl boot separately, follow it with xcrun simctl bootstatus <UDID> before continuing.

App Install and Launch

Installing an App

# Build for simulator first
xcodebuild build \
    -scheme MyApp \
    -destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
    -derivedDataPath build/

# Boot and wait for SpringBoard/services before install
xcrun simctl bootstatus <UDID> -b

# Install the .app bundle
xcrun simctl install <UDID> build/Build/Products/Debug-iphonesimulator/MyApp.app

The path must point to a .app directory built for the simulator architecture, not a .ipa file.

Launching and Terminating

# Launch by bundle ID
xcrun simctl launch booted com.example.MyApp

# Launch and stream stdout/stderr to the terminal
xcrun simctl launch --console booted com.example.MyApp

# Pass launch arguments
xcrun simctl launch booted com.example.MyApp --reset-onboarding -AppleLanguages "(fr)"

# Terminate a running app
xcrun simctl terminate booted com.example.MyApp

--console is useful for debugging — it shows print() and os_log output directly in the terminal.

App Container Paths

# App bundle location
xcrun simctl get_app_container booted com.example.MyApp app

# Data container (Documents, Library, tmp)
xcrun simctl get_app_container booted com.example.MyApp data

# Shared app group container
xcrun simctl get_app_container booted com.example.MyApp group.com.example.shared

Use these paths to inspect sandboxed files, databases, or UserDefaults during debugging.

Testing Workflows

Push Notification Simulation

Create a JSON payload file:

{
    "aps": {
        "alert": {
            "title": "New Message",
            "body": "You have a new message from Alice"
        },
        "badge": 3,
        "sound": "default"
    },
    "customKey": "customValue"
}

Send it to the Simulator:

# Send push payload from file
xcrun simctl push booted com.example.MyApp payload.json

# Pipe payload from stdin
echo '{"aps":{"alert":"Quick test"}}' | xcrun simctl push booted com.example.MyApp -

This simulates local delivery only — no APNs connection is involved. Use this to test payload handling, notification display, and notification actions. Always verify on a real device before shipping to confirm APNs delivery works end to end.

Location Simulation

# Set a fixed coordinate (latitude, longitude)
xcrun simctl location booted set 37.3349,-122.0090

# List available predefined scenarios
xcrun simctl location booted list

# Run a predefined scenario
xcrun simctl location booted run "City Run"

# Follow custom command-line waypoints
xcrun simctl location booted start --speed=15 --interval=1 \
    37.3349,-122.0090 37.3317,-122.0307

# Read waypoints from stdin, one "lat,lon" pair per line
printf "37.3349,-122.0090\n37.3317,-122.0307\n" | \
    xcrun simctl location booted start --distance=100 -

# Clear the simulated location
xcrun simctl location booted clear

Use set for one coordinate, run for predefined scenario names, and start for custom waypoint routes. The command boundary matters: simctl location run accepts built-in scenario names (e.g., "City Run", "Freeway Drive"), not GPX file paths; simctl location start is the command-line path for custom coordinate waypoints. Use Xcode's Debug > Simulate Location menu for GPX-based routes.

Location simulation affects all apps using Core Location on the booted device. Clear the location when done to avoid unexpected test results.

Privacy Permissions

# Grant a permission
xcrun simctl privacy booted grant photos com.example.MyApp

# Revoke a permission
xcrun simctl privacy booted revoke microphone com.example.MyApp

# Reset all permissions for the app
xcrun simctl privacy booted reset all com.example.MyApp

Common service names: photos, microphone, contacts, calendar, reminders, location, location-always, motion, siri. See references/simctl-commands.md for the full list.

Pre-granting permissions in CI avoids system permission dialogs that block automated test runs, but it can mask missing usage description keys. Keep the required Info.plist privacy strings in place and still test the normal prompt flow.

Deep Links and URLs

# Open a URL (triggers universal links or custom URL schemes)
xcrun simctl openurl booted "https://example.com/product/123"

# Custom URL scheme
xcrun simctl openurl booted "myapp://settings/notifications"

For universal links, the app's associated domains entitlement must be configured. The Simulator uses the apple-app-site-association file from the domain.

Status Bar Overrides

# Set a clean status bar for screenshots
xcrun simctl status_bar booted override \
    --time "9:41" \
    --batteryState charged \
    --batteryLevel 100 \
    --cellularMode active \
    --cellularBars 4 \
    --wifiBars 3 \
    --operatorName ""

# Clear all overrides
xcrun simctl status_bar booted clear

Use status bar overrides to produce consistent App Store screenshots. Always clear overrides after capturing to avoid confusing other testing.

Screenshot and Video Recording

# Capture a screenshot
xcrun simctl io booted screenshot screenshot.png

# Record video (press Ctrl+C to stop)
xcrun simctl io booted recordVideo recording.mov

# Screenshot with specific display mask
xcrun simctl io booted screenshot --mask black screenshot.png

--mask options: ignored (default, no mask), alpha (transparent corners), black (black corners). Use alpha or black when capturing screenshots that show the device shape. The alpha mask is only supported for screenshots — video recording falls back to black.

Video recording continues until the process receives SIGINT (Ctrl+C). The recording is saved only after stopping — killing the process with SIGKILL loses the file.

Log Streaming

Basic Log Stream

# Stream all logs at debug level and above
xcrun simctl spawn booted log stream --level debug

# Filter by subsystem
xcrun simctl spawn booted log stream --level debug \
    --predicate 'subsystem == "com.example.app"'

# Filter by subsystem and category
xcrun simctl spawn booted log stream --level debug \
    --predicate 'subsystem == "com.example.app" AND category == "networking"'

# Filter by process name
xcrun simctl spawn booted log stream \
    --predicate 'process == "MyApp"'

Combining with os.Logger

Design subsystems and categories for filterability:

import os

let networkLogger = Logger(subsystem: "com.example.app", category: "networking")
let uiLogger = Logger(subsystem: "com.example.app", category: "ui")

func fetchData() async throws -> Data {
    networkLogger.debug("Starting request to /api/data")
    let (data, response) = try await URLSession.shared.data(from: url)
    networkLogger.info("Received \(data.count) bytes, status: \((response as? HTTPURLResponse)?.statusCode ?? 0)")
    return data
}

Then filter the log stream to see only networking output:

xcrun simctl spawn booted log stream --level debug \
    --predicate 'subsystem == "com.example.app" AND category == "networking"'

Compile-Time Simulator Detection

Use #if targetEnvironment(simulator) to exclude code that cannot run in the Simulator:

func registerForPush() {
    #if targetEnvironment(simulator)
    logger.info("Skipping APNs registration — running in Simulator")
    #else
    UIApplication.shared.registerForRemoteNotifications()
    #endif
}

Runtime detection via environment variables:

var isSimulator: Bool {
    ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] != nil
}

Prefer compile-time checks (#if targetEnvironment(simulator)) over runtime checks. The compiler strips excluded code entirely, preventing linker errors from unavailable symbols.

Simulator Limitations

When classifying a test as Simulator-supported or hardware-required, separate "can trigger this behavior" from "can validate real-device fidelity":

  • Simulator-supported triggers/proxies: local push with simctl push, location changes, memory warnings, Face ID or Touch ID enrollment/match/nonmatch menu actions, manual iCloud sync trigger, privacy grants/resets, status bar overrides, screenshots, and video capture.
  • Hardware-required validation: APNs delivery, BLE and NFC, real camera or microphone input, motion sensors, Secure Enclave, App Attest, automatic iCloud propagation/conflicts/background behavior, CPU throughput, general processing speed, networking throughput or latency, Metal shader correctness, GPU limits, memory bandwidth, frame timing, memory pressure, Jetsam, and thermal behavior.

Do not classify "iCloud sync" as a single hardware-only item. Split it explicitly:

  • Simulator-supported: manual iCloud sync triggering and basic app response to sync callbacks.
  • Hardware-required: automatic iCloud propagation, multiple real devices/accounts, conflict resolution, notification-triggered sync, background delivery, and account/device state differences.
CapabilitySimulator Support
APNs push deliveryNo — use simctl push for local simulation
Performance fidelityRelative only — Simulator is not accurate for CPU/processing performance, networking speed, graphics/Metal, memory bandwidth, frame timing, memory pressure, Jetsam, shader correctness, or thermal behavior; verify performance-sensitive work on hardware
Metal GPU family parityPartial — Simulator uses the host Mac GPU, not the device GPU; some shaders and limits differ
Camera hardwareNo — use photo library injection or mock AVCaptureSession
Audio input / microphoneNo general app audio input; Siri can be activated from Simulator menus
Secure EnclaveNo — kSecAttrTokenIDSecureEnclave operations fail
App Attest (DCAppAttestService)No — isSupported returns false
DockKit motor controlNo — no physical accessory connection
Accelerometer / GyroscopeNo motion sensor support; use real devices for motion-dependent behavior
BarometerNo
NFC (Core NFC)No
Bluetooth (Core Bluetooth)No — use a real device for BLE testing
CarPlay display simulationSupported through Simulator's external display/CarPlay option; still verify in vehicle or device setups
Face ID / Touch ID hardwareNo hardware — use Features > Face ID / Touch ID menu in Simulator
Memory warnings, manual iCloud sync trigger, location changesSupported through Simulator menus or simctl where available
Automatic iCloud sync behaviorNot fully simulated — validate notification-triggered sync, real account/device propagation, conflicts, and background behavior on hardware
Cellular network conditionsNo — use Network Link Conditioner on Mac

Treat Simulator performance as a functional smoke signal only. When answering performance-boundary questions, explicitly name CPU throughput/general processing speed and networking throughput/latency alongside graphics, Metal shader correctness, memory bandwidth, frame timing, memory pressure, Jetsam behavior, and thermal behavior.

Use this minimum wording in release-checklist answers: "Simulator is not an accurate performance proxy for processing/CPU, graphics/Metal, memory, networking throughput/latency, Metal GPU behavior, frame timing, memory pressure/Jetsam, or thermal behavior." If a prompt only names "Metal performance," still include processing, memory, and networking in the device-verification list.

Common Mistakes

DON'T: Hardcode simulator UDIDs in scripts

UDIDs change when simulators are deleted and recreated. Hardcoded values break on other machines and CI.

# WRONG — hardcoded UDID
xcrun simctl boot "A1B2C3D4-E5F6-7890-ABCD-EF1234567890"

# CORRECT — look up by name and runtime
UDID=$(xcrun simctl list -j devices available | \
    jq -r '.devices["com.apple.CoreSimulator.SimRuntime.iOS-18-4"][] | select(.name == "iPhone 16 Pro") | .udid')
xcrun simctl boot "$UDID"

# CORRECT — use "booted" when one simulator is running
xcrun simctl install booted MyApp.app

DON'T: Install or launch on a shutdown simulator

simctl install and simctl launch require a booted device. They fail silently or with an unhelpful error on a shutdown device.

# WRONG — device is not booted
xcrun simctl install <UDID> MyApp.app  # fails

# CORRECT — boot first, then install
xcrun simctl boot <UDID>
xcrun simctl install <UDID> MyApp.app
xcrun simctl launch <UDID> com.example.MyApp

DON'T: Leave zombie simulators running in CI

Each booted simulator consumes memory and CPU. CI pipelines that create simulators without cleanup accumulate zombie devices.

# WRONG — CI script creates and boots but never cleans up
xcrun simctl create "CI Phone" "iPhone 16 Pro" "com.apple.CoreSimulator.SimRuntime.iOS-18-4"
xcrun simctl boot "$UDID"
# ... tests run, pipeline exits ...

# CORRECT — always clean up in CI teardown
cleanup() {
    xcrun simctl shutdown all
    xcrun simctl delete "$UDID"
}
trap cleanup EXIT

DON'T: Assume simctl push validates APNs delivery

simctl push bypasses the entire APNs infrastructure. It tests payload parsing and notification UI, not token registration, entitlements, or server-side delivery.

# WRONG — only testing with simctl, shipping without real device testing
xcrun simctl push booted com.example.MyApp payload.json
# "Push works!" — no, it only proves the app handles the payload

# CORRECT — use simctl for development iteration, then verify end-to-end on a real device
# 1. simctl push during development for fast iteration
# 2. Real device + APNs sandbox for integration testing before release

DON'T: Keep retrying boot on a stuck simulator

A simulator stuck in the "Booting" state will not recover by retrying boot. The underlying CoreSimulator state is corrupted.

# WRONG — retry loop on a stuck device
xcrun simctl boot "$UDID"  # "Unable to boot device in current state: Booting"
xcrun simctl boot "$UDID"  # same error, forever

# CORRECT — shut down, erase, and retry
xcrun simctl shutdown "$UDID"
xcrun simctl erase "$UDID"
xcrun simctl boot "$UDID"

# If that fails, reset CoreSimulator entirely
xcrun simctl shutdown all
xcrun simctl erase all
# Last resort: rm -rf ~/Library/Developer/CoreSimulator/Caches

Review Checklist

  • [ ] Simulator devices created with explicit device type and runtime identifiers
  • [ ] Scripts use booted or parsed UDID from JSON output, not hardcoded values
  • [ ] Push notification payloads tested via simctl push during development
  • [ ] Push notification delivery verified on a real device before release
  • [ ] Location simulation tested with fixed coordinates, predefined scenarios, and custom waypoints when needed
  • [ ] Privacy permissions pre-granted in CI to avoid blocking dialogs
  • [ ] #if targetEnvironment(simulator) guards around APIs unavailable in Simulator
  • [ ] Status bar overrides cleared after capturing screenshots
  • [ ] CI pipelines shut down and delete simulators in teardown
  • [ ] Log streaming configured with subsystem/category predicates for focused debugging
  • [ ] App container paths used for inspecting sandboxed data during debugging

References

Related skills

How it compares

Pick ios-simulator for CLI simctl automation; use XCUITest skills for in-app UI interaction testing.

FAQ

What does ios-simulator do?

Manages iOS Simulator devices and tests app behavior using xcrun simctl. Covers device lifecycle (create, boot, shutdown, erase, delete), app install and launch, push notification simulation, location

When should I use ios-simulator?

During ship testing work for testing & qa.

Is ios-simulator safe to install?

Review the Security Audits panel on this listing before production use.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.