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

Function waitForFixtureRegistration

scripts/integration/cli.mjs:1052–1073  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1050}
1051
1052async function waitForFixtureRegistration() {
1053 let lastError = null;
1054 for (let attempt = 1; attempt <= 12; attempt += 1) {
1055 try {
1056 const appContainer = runText(
1057 "xcrun",
1058 ["simctl", "get_app_container", simulatorUDID, fixtureBundleId],
1059 { timeoutMs: 60_000 },
1060 ).trim();
1061 if (appContainer.length > 0) {
1062 logStep(`fixture registered at ${appContainer}`);
1063 return appContainer;
1064 }
1065 } catch (error) {
1066 lastError = error;
1067 }
1068 await sleep(1_000);
1069 }
1070 throw new Error(
1071 `fixture app was not registered after install: ${summarizeError(lastError)}`,
1072 );
1073}
1074
1075function summarizeError(error) {
1076 return String(error?.message ?? error)

Callers

nothing calls this directly

Calls 4

logStepFunction · 0.85
summarizeErrorFunction · 0.85
runTextFunction · 0.70
sleepFunction · 0.70

Tested by

no test coverage detected