MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / simulatorInventory

Function simulatorInventory

scripts/studio-host-provider.mjs:487–506  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

485}
486
487async function simulatorInventory() {
488 const [devicesJson, deviceTypesJson, runtimesJson] = await Promise.all([
489 execJson("xcrun", ["simctl", "list", "-j", "devices"]),
490 execJson("xcrun", ["simctl", "list", "-j", "devicetypes"]),
491 execJson("xcrun", ["simctl", "list", "-j", "runtimes"]),
492 ]);
493 const devices = [];
494 for (const [runtimeName, runtimeDevices] of Object.entries(
495 devicesJson.devices || {},
496 )) {
497 for (const device of runtimeDevices || []) {
498 devices.push({ ...device, runtimeName });
499 }
500 }
501 return {
502 deviceTypes: deviceTypesJson.devicetypes || [],
503 devices,
504 runtimes: runtimesJson.runtimes || [],
505 };
506}
507
508async function cloneSimulator(templateUdid, name) {
509 return (

Callers 1

ensureTemplateSimulatorFunction · 0.85

Calls 1

execJsonFunction · 0.85

Tested by

no test coverage detected