iOS Simulator
2020/04/26 xcrun simctl by jean tran
Usually when you've installed/updated Xcode, it will also prompt a notification suggesting to you to update your 'command line tools'. From here simctl
is accessible through the xcrun
command in your terminal.
Managing Simulator Devices
Running list command, it will prompt a list of the available runtimes devices informations.
Each devices are ordered by iOS, has a name, associated UUID and status (Booted|Shutdown).
It's possible to launch a specific simulator by providing it UUID value:
To access to booted simulator:
To check which simulator are booted, combine the
list
subcommand withgrep
:
To access booted device UUID, can be done completing previous command with a regexp
It's also possible by using -j or --json subcommand to have an output as JSON. Which could be convenient when managing simulators using scripts or programs.
Finally using
shutdown
anderase
subcommands, can be use to close and clear your simulator contents.
Tips: You've been working for a while and update Xcode version for few times. You've probably accumulate several version of old devices. For most, you will probably using the latest simulators version. The following command will free you few gigabytes of disk space.
Simctl subcommands examples
addmedia
screen/video capture
openurl
Case to open in the simulator by providing a web link:
Case to open in the simulator by using URL Scheme:
Simctrl Xcode 11.4
Dark/Light mode
Toggle appearance modes: light/dark
keychain
Install certificates for trusted connections via drag and drop or terminal:
privacy location and permission
Changing or reset simulator-device privacy permissions: location always, when app in use...
resetting or applying all permissions:
push notifications
Simulator supports background content fetch notifications and remote push notifications.
Also, simctl has the subcommand push for remote push notifications.
Status bar
Change device status bar properties:
Last updated
Was this helpful?