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

Function findBootedSimulatorUDID

scripts/experimental/swiftui-preview.mjs:944–956  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

942}
943
944function findBootedSimulatorUDID() {
945 const data = JSON.parse(
946 runText("xcrun", ["simctl", "list", "devices", "booted", "-j"]),
947 );
948 for (const runtimes of Object.values(data.devices ?? {})) {
949 for (const device of runtimes) {
950 if (device.state === "Booted") {
951 return device.udid;
952 }
953 }
954 }
955 return "";
956}
957
958function extractPreviews(source) {
959 const previews = [];

Callers 1

mainFunction · 0.85

Calls 3

runTextFunction · 0.70
valuesMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected