Skip to content

Instantly share code, notes, and snippets.

@ahcode0919
Last active June 8, 2024 11:49
Show Gist options
  • Save ahcode0919/fba90a8c4d6c5026573a8ecf77f09aca to your computer and use it in GitHub Desktop.
Save ahcode0919/fba90a8c4d6c5026573a8ecf77f09aca to your computer and use it in GitHub Desktop.
Apple Simctl commands

Simctl

An Xcode/CoreSimulator command line utility to control iOS Simulators on MacOS

Command Usage

simctl [--set <path>] [--profiles <path>] <subcommand> ... simctl help [subcommand]

Documented Commands

Command Description
addmedia Add photos, live photos, videos, or contacts to the library of a device
boot Boot a device
clone Clone an existing device
create Create a new device
delete Delete spcified devices, unavailable devices, or all devices
diagnose Collect diagnostic information and logs
erase Erase a device's contents and settings
get_app_container Print the path of the installed app's container
getenv Print an environment variable from a running device
help Prints the usage for a given subcommand
icloud_sync Trigger iCloud sync on a device
install Install an app on a device
io Set up a device IO operation
keychain Manipulate a device's keychain
launch Launch an application by identifier on a device
list List available devices, device types, runtimes, or device pairs
logverbose enable or disable verbose logging for a device
openurl Open a URL in a device
pair Create a new watch and phone pair
pair_activate Set a given pair as active
pbcopy Copy standard input onto the device pasteboard
pbpaste Print the contents of the device's pasteboard to standard output
pbsync Sync the pasteboard content from one pasteboard to another
privacy Grant, revoke, or reset privacy and permissions
push Send a simulated push notification
rename Rename a device
shutdown Shutdown a device
spawn Spawn a process by executing a given executable on a device
status_bar Set or clear status bar overrides
terminate Terminate an application by identifier on a device
ui Get or Set UI options
unpair Unpair a watch and phone pair
upgrade Upgrade a device to a newer runtime
uninstall Uninstall an app from a device

Undocumented Commands

Command Description
addphoto Add photos
addvideo Add video
appinfo Get application bundle information
bootstatus Get device boot status
darwinup Install a root for the specified simulator runtime
disk Perform disk operations, like simulating volume unmount
keyboard Change the keyboard locale/language
listapps List installed applications
monitor List notifications as they arrive
notify_post Post a darwin notification on a device
notify_get_state Get the state value of a darwin notification on a device
notify_set_state Set the state value of a darwin notification on a device
pbinfo Print information about the device's pasteboard
register Register a service from one bootstrap into another
reset Reset a given archive or database
runtime Locate, copy, mount, and unmount simulator runtime disk images
spawn Spawn a process by executing a given executable on a device
unregister Unregister a service from a device's bootstrap

Usage Notes

Usage tips and notes.

UDID/Booted

For subcommands that require a <device> argument, you may specify a device UDID or the special "booted" string which will cause simctl to pick a booted device. If multiple devices are booted when the "booted" device is selected, simctl will choose one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment