simctl: Control iOS Simulators from Command Line - tutorial
iOS simulator command line tricks - another one
You may set alias for commands in your .bash_profile or .zprofile as below:
alias simDevices="xcrun simctl list"
tanya@Tanyas-MacBook-Pro ~ % xcrun simctl help
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.
Subcommands:
create Create a new device.
clone Clone an existing device.
upgrade Upgrade a device to a newer runtime.
delete Delete spcified devices, unavailable devices, or all devices. They have a typo;)
pair Create a new watch and phone pair.
unpair Unpair a watch and phone pair.
pair_activate Set a given pair as active.
erase Erase a device's contents and settings.
boot Boot a device.
shutdown Shutdown a device.
rename Rename a device.
getenv Print an environment variable from a running device.
openurl Open a URL in a device.
addmedia Add photos, live photos, videos, or contacts to the library of a device.
install Install an app on a device.
uninstall Uninstall an app from a device.
get_app_container Print the path of the installed app's container
launch Launch an application by identifier on a device.
terminate Terminate an application by identifier on a device.
spawn Spawn a process by executing a given executable on a device.
list List available devices, device types, runtimes, or device pairs.
icloud_sync Trigger iCloud sync on a device.
pbsync Sync the pasteboard content from one pasteboard to another.
pbcopy Copy standard input onto the device pasteboard.
pbpaste Print the contents of the device's pasteboard to standard output.
help Prints the usage for a given subcommand.
io Set up a device IO operation.
diagnose Collect diagnostic information and logs.
logverbose enable or disable verbose logging for a device
status_bar Set or clear status bar overrides
tanya@Tanyas-MacBook-Pro ~ % xcrun simctl getenv booted SIMULATOR_LOG_ROOT
/Users/tanya/Library/Logs/CoreSimulator/FB6F56A4-BEF8-40BE-983A-DB3081F99FCF
Note: FB6F56A4-BEF8-40BE-983A-DB3081F99FCF is the device’s UDID
https://developer.apple.com/videos/play/wwdc2021/10209/ videos from WWDC2021
Debugging in Xcode 11 - video from WWDC 2019
Understanding Crashes and Crash Logs - video from WWDC 2019
Read about simulator - from apple.com and more here. And this is why we can’t install .ipa and need .app file
Emulator overview - from android.com, scroll to the bottom for Limitations part
Mobile Device Emulator and Simulator vs Real Device - from SouceLabs
xcrun simctl spawn booted log stream - getting logs from iOS simulator by Portnov computer school student; use grep <bundle_id> ro filter
Tracking down the app crash in Xcode
Accessing device logs and .crash files in Xcode
Installing .app on Simulator from Terminal
xcrun simctl io booted recordVideo filename.mov - recording simulator screen by Portnov computer school student
xcrun simctl io booted screenshot filename.png - recording simulator screen by Portnov computer school student
https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes