Repository navigation
Expand file tree
/
Copy pathsimctl-facade.ts
More file actions
41 lines (38 loc) · 1.5 KB
/
Copy pathsimctl-facade.ts
File metadata and controls
41 lines (38 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { DeviceInfo } from '@agent-device/kernel/device';
import { buildSimctlArgsForDevice } from './core/simctl.ts';
import type { ScopedSimctlCommand } from './core/tool-provider.ts';
export { buildSimctlArgsForDevice };
export {
iosPrivacyAction,
iosPrivacyServiceRefusedError,
isIosPrivacyServiceRefusal,
parseIosAppearance,
parseIosPrivacyService,
} from './core/simctl-settings.ts';
/**
* Builds the `simctl io recordVideo` argv for one Apple simulator, naming the panel the device
* currently lights.
*
* A foldable lights one panel at a time and simctl's implicit display default is the highest screen
* ID — the dark panel — so a recording that omits `--display` captures black while exiting 0. The
* panel decision belongs to the Apple package, which owns the display inventory.
*
* The inventory is imported per call, not statically: this façade keeps its eager closure at the
* simctl argv builder, and recording is not a startup path.
*/
export async function buildAppleSimulatorRecordVideoArgs(
device: DeviceInfo,
outputPath: string,
options: { timeoutMs?: number; signal?: AbortSignal } = {},
): Promise<ScopedSimctlCommand> {
const { appleSimulatorDisplayArgvFragment, resolveAppleCaptureDisplay } =
await import('./core/display-inventory.ts');
const display = await resolveAppleCaptureDisplay(device, options);
return buildSimctlArgsForDevice(device, [
'io',
device.id,
'recordVideo',
...appleSimulatorDisplayArgvFragment(display),
outputPath,
]);
}