It seems devicectl
doesn't support taking screenshots at this moment, unless it's a hidden command.
Closest you can get:
xcrun devicectl device info details --device XXX -j ~/Downloads/details.json
Contains: "screenViewingURL" : "devices://device/open?id=XXX"
and { "featureIdentifier" : "com.apple.coredevice.feature.viewdevicescreen", "name" : "View Device Screen" },
is granted.
Not sure how to use that URL though...
And xcrun devicectl device info displays --device XXX -j ~/Downloads/displays.json
Contains:
"result" : {
"backlightState" : "off",
"current" : true,
"displays" : [
{
"bounds" : [
[
0,
0
],
[
1179,
2556
]
],
"currentOrientation" : "rot0",
"displayId" : 1,
"name" : "LCD",
"nativeOrientation" : "rot0",
"nativeSize" : [
1179,
2556
],
"pointScale" : 3,
"primary" : true
}
]
But not a way to grab a screenshot from that display.
simctl
on the other hand has simctl io booted screenshot
Maybe the copy
command in combination with process launch
can be used to launch a process that takes a screenshot and writes it to a path, then copy that file from the device.
But would be very helpful if Apple would add a screenshot argument to devicectl
.