Skip to content

Commit 240667a

Browse files
authored
Update simctl to Xcode 14 (#14)
1 parent 341b894 commit 240667a

File tree

2 files changed

+269
-24
lines changed

2 files changed

+269
-24
lines changed

specs/simctl.txt

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Subcommands:
2626
keychain Manipulate a device's keychain
2727
launch Launch an application by identifier on a device.
2828
list List available devices, device types, runtimes, or device pairs.
29+
location Control a device's simulated location
2930
logverbose enable or disable verbose logging for a device
3031
openurl Open a URL in a device.
3132
pair Create a new watch and phone pair.
@@ -36,6 +37,7 @@ Subcommands:
3637
privacy Grant, revoke, or reset privacy and permissions
3738
push Send a simulated push notification
3839
rename Rename a device.
40+
runtime Perform operations on runtimes
3941
shutdown Shutdown a device.
4042
spawn Spawn a process by executing a given executable on a device.
4143
status_bar Set or clear status bar overrides
@@ -249,6 +251,41 @@ Usage: simctl list [-j | --json] [-e | --no-escape-slashes] [-v] [devices|device
249251
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.
250252

251253

254+
xcrun simctl help location
255+
Control a device's simulated location
256+
Usage: simctl location <device> <action> [arguments]
257+
258+
list
259+
List available simulation scenarios.
260+
261+
clear
262+
Stop any running scenario and clear any simulated location.
263+
264+
set <lat1>,<lon1>
265+
Set the location to a specific latitude and longitude.
266+
267+
run <scenario>
268+
Run a simulated location scenario (use the list action to get a list of scenarios).
269+
270+
start [--speed=<meters/sec>] [--distance=<meters per second>|--interval=<seconds>] <lat1>,<lon1> <latN>,<lonN>...
271+
Set the location to a series of waypoints specified as 'lat,lon' pairs, interpolating between them over time.
272+
At least two waypoints are required. Use '-' to read waypoints from stdin, one waypoint per line.
273+
274+
Speed specifies how quickly to move between waypoints in meters per second. If not specified 20m/s is used.
275+
276+
The system will issue location updates along the path between each pair of waypoints. Use distance or interval to
277+
control how often those updates are issued. Distance will issue an update every <meters> travelled without regard
278+
for the time between updates. Interval will issue updates at fixed times without regard for how much
279+
the location moves between updates.
280+
If neither are specified an interval of 1.0 seconds is used. If both are specified the system picks ones.
281+
282+
Example simulating a direct line between San Francisco and New York City, with updates every km:
283+
set --distance=1000 --speed=260 37.629538,-122.395733 40.628083,-73.768254
284+
285+
Latitude and longitude pairs must be specified using '.' as the decimal separator and ',' as the field separator.
286+
287+
288+
252289
xcrun simctl help logverbose
253290
enable or disable verbose logging for a device
254291
Usage: simctl logverbose [<device>] (enable | disable)
@@ -344,6 +381,73 @@ xcrun simctl help rename
344381
Rename a device.
345382
Usage: simctl rename <device> <name>
346383

384+
xcrun simctl help runtime
385+
Perform operations on runtimes
386+
Usage: simctl runtime <operation> <arguments>
387+
388+
Supported Operations:
389+
add <path> [-ma]
390+
Add a runtime disk image to the secure storage area. The image will be staged, verified, and mounted.
391+
When possible the image file will be cloned so no additional disk space will be used.
392+
If stdout is a terminal and a copy is required then progress will be reported.
393+
394+
--move | -m
395+
Remove the original file if the image is added successfully. If the image cannot be staged
396+
or the add fails the original is not removed.
397+
--async | -a
398+
Print the UUID of the new image then exit, do not wait on the results of the add operation.
399+
400+
delete (<identifier>|--notUsedSinceDays <days>) [--dry-run]
401+
Delete a simulator runtime from the secure storage area. If runtime is a disk image
402+
any booted simulators are shutdown and the disk is unmounted first.
403+
Use the alias 'all' to delete all images.
404+
405+
--notUsedSinceDays <days> | -d <days>
406+
Delete images not used within the past <days> days.
407+
--dry-run | -n
408+
Print what images would be deleted without actually deleting anything.
409+
410+
verify <identifier>
411+
Re-verify the signature of a given runtime.
412+
413+
list [-v] [-j | --json]
414+
List runtime disk images, optionally outputting JSON to stdout.
415+
-v
416+
Print more verbose output
417+
-j
418+
Print as JSON
419+
420+
match list [-v] [-j | --json]
421+
List the SDK build to runtime build mapping rules for the selected Xcode.
422+
Preferred means the runtime was either bundled with Xcode, exactly matched your SDK version,
423+
or the downloadable index indicated a better match for your SDK
424+
. Manual overrides using 'match set' have the highest priority.
425+
426+
-v
427+
Verbose mode. Includes the full preferred build map, user override map, and known SDK names.
428+
-j
429+
Print as JSON
430+
431+
match set <sdk canonical name> (<runtime build> || --default) [--sdkBuild <sdk build>]
432+
Override the SDK to runtime build mapping. This controls which build of a given runtime
433+
Xcode will prefer for building and running when using that SDK. This matters most
434+
often during Beta releases when there are multiple builds for a given OS version.
435+
If --sdkBuild is not specified it is assumed you mean the SDK build for the currently selected Xcode.
436+
437+
Note: Remember this is about build numbers, not semantic versions. When using the iOS 16.0 SDK Xcode
438+
will always prefer an iOS 16.0 runtime. Matching policy controls what to do when there are multiple
439+
iOS 16.0 runtimes available,
440+
eg if the iOS 16.0 SDK is 20A245 and the available runtimes are (20A248, 20A252, 20A254) which one
441+
should Xcode use for building, SwiftUI Previews, and when launching iOS 16.0 Simulators?
442+
They are all iOS 16.0 runtimes so a policy must decide which one is selected.
443+
444+
--default
445+
Clear the override for the given SDK and revert to default behavior.
446+
--sdkBuild
447+
Explicitly specify the SDK build, eg for an Xcode other than the selected Xcode.
448+
449+
450+
347451
xcrun simctl help shutdown
348452
Shutdown a device.
349453
Usage: simctl shutdown <device> | all
@@ -540,7 +644,6 @@ NOTE: If you install or uninstall roots, you must manually update the dyld_sim s
540644
See simctl help legacyruntime for information about triggering a dyld_sim shared cache rebuild.
541645

542646

543-
544647
xcrun simctl help legacyruntime
545648
Locate, copy, mount, and unmount simulator runtime disk images.
546649
Usage: simctl legacyruntime <operation> <arguments>

0 commit comments

Comments
 (0)