MCPcopy Create free account
hub / github.com/expo/expo / queryFirstBootedSimulatorAsync

Function queryFirstBootedSimulatorAsync

tools/src/IOSSimulator.ts:122–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120}
121
122export async function queryFirstBootedSimulatorAsync(): Promise<SimulatorUdid | null> {
123 const { stdout } = await spawnAsync('xcrun', [
124 'simctl',
125 'list',
126 'devices',
127 'iPhone',
128 'booted',
129 '--json',
130 ]);
131 const { devices: devicesWithRuntimes } = JSON.parse(stdout);
132
133 for (const devices of Object.values<{ udid: string }[]>(devicesWithRuntimes)) {
134 if (devices.length > 0) {
135 return devices[0].udid;
136 }
137 }
138
139 return null;
140}

Callers

nothing calls this directly

Calls 3

spawnAsyncFunction · 0.85
valuesMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…