Skip to content

Commit

Permalink
Update simctl to Xcode 14 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
odnoletkov authored Jan 11, 2023
1 parent 341b894 commit 240667a
Show file tree
Hide file tree
Showing 2 changed files with 269 additions and 24 deletions.
105 changes: 104 additions & 1 deletion specs/simctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Subcommands:
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.
location Control a device's simulated location
logverbose enable or disable verbose logging for a device
openurl Open a URL in a device.
pair Create a new watch and phone pair.
Expand All @@ -36,6 +37,7 @@ Subcommands:
privacy Grant, revoke, or reset privacy and permissions
push Send a simulated push notification
rename Rename a device.
runtime Perform operations on runtimes
shutdown Shutdown a device.
spawn Spawn a process by executing a given executable on a device.
status_bar Set or clear status bar overrides
Expand Down Expand Up @@ -249,6 +251,41 @@ Usage: simctl list [-j | --json] [-e | --no-escape-slashes] [-v] [devices|device
Specify one of 'devices', 'devicetypes', 'runtimes', or 'pairs' to list only items of that type. If a type filter is specified you may also specify a search term. Search terms use a simple case-insensitive contains check against the item's description. You may use the search term 'available' to only list available items.


xcrun simctl help location
Control a device's simulated location
Usage: simctl location <device> <action> [arguments]

list
List available simulation scenarios.

clear
Stop any running scenario and clear any simulated location.

set <lat1>,<lon1>
Set the location to a specific latitude and longitude.

run <scenario>
Run a simulated location scenario (use the list action to get a list of scenarios).

start [--speed=<meters/sec>] [--distance=<meters per second>|--interval=<seconds>] <lat1>,<lon1> <latN>,<lonN>...
Set the location to a series of waypoints specified as 'lat,lon' pairs, interpolating between them over time.
At least two waypoints are required. Use '-' to read waypoints from stdin, one waypoint per line.

Speed specifies how quickly to move between waypoints in meters per second. If not specified 20m/s is used.

The system will issue location updates along the path between each pair of waypoints. Use distance or interval to
control how often those updates are issued. Distance will issue an update every <meters> travelled without regard
for the time between updates. Interval will issue updates at fixed times without regard for how much
the location moves between updates.
If neither are specified an interval of 1.0 seconds is used. If both are specified the system picks ones.

Example simulating a direct line between San Francisco and New York City, with updates every km:
set --distance=1000 --speed=260 37.629538,-122.395733 40.628083,-73.768254

Latitude and longitude pairs must be specified using '.' as the decimal separator and ',' as the field separator.



xcrun simctl help logverbose
enable or disable verbose logging for a device
Usage: simctl logverbose [<device>] (enable | disable)
Expand Down Expand Up @@ -344,6 +381,73 @@ xcrun simctl help rename
Rename a device.
Usage: simctl rename <device> <name>

xcrun simctl help runtime
Perform operations on runtimes
Usage: simctl runtime <operation> <arguments>

Supported Operations:
add <path> [-ma]
Add a runtime disk image to the secure storage area. The image will be staged, verified, and mounted.
When possible the image file will be cloned so no additional disk space will be used.
If stdout is a terminal and a copy is required then progress will be reported.

--move | -m
Remove the original file if the image is added successfully. If the image cannot be staged
or the add fails the original is not removed.
--async | -a
Print the UUID of the new image then exit, do not wait on the results of the add operation.

delete (<identifier>|--notUsedSinceDays <days>) [--dry-run]
Delete a simulator runtime from the secure storage area. If runtime is a disk image
any booted simulators are shutdown and the disk is unmounted first.
Use the alias 'all' to delete all images.

--notUsedSinceDays <days> | -d <days>
Delete images not used within the past <days> days.
--dry-run | -n
Print what images would be deleted without actually deleting anything.

verify <identifier>
Re-verify the signature of a given runtime.

list [-v] [-j | --json]
List runtime disk images, optionally outputting JSON to stdout.
-v
Print more verbose output
-j
Print as JSON

match list [-v] [-j | --json]
List the SDK build to runtime build mapping rules for the selected Xcode.
Preferred means the runtime was either bundled with Xcode, exactly matched your SDK version,
or the downloadable index indicated a better match for your SDK
. Manual overrides using 'match set' have the highest priority.

-v
Verbose mode. Includes the full preferred build map, user override map, and known SDK names.
-j
Print as JSON

match set <sdk canonical name> (<runtime build> || --default) [--sdkBuild <sdk build>]
Override the SDK to runtime build mapping. This controls which build of a given runtime
Xcode will prefer for building and running when using that SDK. This matters most
often during Beta releases when there are multiple builds for a given OS version.
If --sdkBuild is not specified it is assumed you mean the SDK build for the currently selected Xcode.

Note: Remember this is about build numbers, not semantic versions. When using the iOS 16.0 SDK Xcode
will always prefer an iOS 16.0 runtime. Matching policy controls what to do when there are multiple
iOS 16.0 runtimes available,
eg if the iOS 16.0 SDK is 20A245 and the available runtimes are (20A248, 20A252, 20A254) which one
should Xcode use for building, SwiftUI Previews, and when launching iOS 16.0 Simulators?
They are all iOS 16.0 runtimes so a policy must decide which one is selected.

--default
Clear the override for the given SDK and revert to default behavior.
--sdkBuild
Explicitly specify the SDK build, eg for an Xcode other than the selected Xcode.



xcrun simctl help shutdown
Shutdown a device.
Usage: simctl shutdown <device> | all
Expand Down Expand Up @@ -540,7 +644,6 @@ NOTE: If you install or uninstall roots, you must manually update the dyld_sim s
See simctl help legacyruntime for information about triggering a dyld_sim shared cache rebuild.



xcrun simctl help legacyruntime
Locate, copy, mount, and unmount simulator runtime disk images.
Usage: simctl legacyruntime <operation> <arguments>
Expand Down
Loading

0 comments on commit 240667a

Please sign in to comment.