LinuxCommandLibrary

simctl

TLDR

List all simulators and runtimes

$ xcrun simctl list
copy
Boot a simulator by name or UUID
$ xcrun simctl boot "[iPhone 15 Pro]"
copy
Shutdown a simulator
$ xcrun simctl shutdown [device_uuid|booted]
copy
Install an app on a booted simulator
$ xcrun simctl install booted [path/to/app.app]
copy
Launch an app on the simulator
$ xcrun simctl launch booted [com.example.bundleid]
copy
Take a screenshot of the simulator
$ xcrun simctl io booted screenshot [output.png]
copy
Send a push notification
$ xcrun simctl push booted [com.example.bundleid] [notification.apns]
copy
Grant a privacy permission to an app
$ xcrun simctl privacy booted grant [location] [com.example.bundleid]
copy

SYNOPSIS

xcrun simctl subcommand [arguments]

DESCRIPTION

simctl is Apple's command-line tool for managing and interacting with iOS, watchOS, and tvOS simulators on macOS. It's accessed through xcrun simctl to ensure the correct version matching your active Xcode installation is used.
The tool provides comprehensive control over simulator lifecycle (create, boot, shutdown, delete), application management (install, launch, uninstall), and testing features (push notifications, privacy permissions, screenshots, video recording). It's particularly useful for automated testing, CI/CD pipelines, and development workflows.
The special identifier booted can be used to target the currently running simulator instead of specifying a UUID.

SUBCOMMANDS

list [devices|devicetypes|runtimes|pairs]

List available devices, device types, runtimes, or device pairs.
create name devicetype runtime
Create a new simulator with the specified name, device type, and runtime.
delete device
Delete a simulator device.
boot device
Boot a simulator device.
shutdown device|all
Shutdown a simulator or all simulators.
erase device|all
Erase a simulator's contents and settings.
install device apppath_
Install an application bundle on a simulator.
uninstall device bundleid_
Uninstall an application by bundle identifier.
launch device bundleid [args_]
Launch an application on a simulator.
terminate device bundleid_
Terminate a running application.
io device operation
Perform I/O operations: screenshot, recordVideo.
push device bundleid jsonfile
Send a push notification to a running application.
privacy device action service bundleid_
Manage privacy permissions (grant, revoke, reset).
addmedia device paths
Add photos or videos to the simulator's photo library.
openurl device url
Open a URL in the simulator.
runtime add|delete path
Manage simulator runtime disk images.
help [subcommand]
Display help for simctl or a specific subcommand.

CAVEATS

Only available on macOS with Xcode installed. Requires the Xcode Command Line Tools. Some features like privacy management require Xcode 11.4 or later. Simulator runtimes consume significant disk space. The tool path is /Applications/Xcode.app/Contents/Developer/usr/bin/simctl but should be invoked via xcrun to ensure version compatibility.

HISTORY

simctl was introduced by Apple as part of Xcode to replace older simulator management tools. It has evolved alongside iOS development, gaining features for push notification testing, privacy permission management, and improved runtime handling. The tool has become essential for iOS CI/CD workflows and automated testing, comparable to Android's adb command.

SEE ALSO

Copied to clipboard