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

Function preapproveFixtureUrlScheme

scripts/integration/js-api.mjs:521–554  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

519}
520
521function preapproveFixtureUrlScheme() {
522 const plist = path.join(
523 os.homedir(),
524 "Library",
525 "Developer",
526 "CoreSimulator",
527 "Devices",
528 simulatorUDID,
529 "data",
530 "Library",
531 "Preferences",
532 "com.apple.launchservices.schemeapproval.plist",
533 );
534 const key = `com.apple.CoreSimulator.CoreSimulatorBridge-->${fixtureUrlScheme}`;
535 fs.mkdirSync(path.dirname(plist), { recursive: true });
536 const setResult = spawnSync(
537 "/usr/libexec/PlistBuddy",
538 ["-c", `Set :${key} ${fixtureBundleId}`, plist],
539 {
540 cwd: root,
541 encoding: "utf8",
542 timeout: 60_000,
543 },
544 );
545 if (setResult.status !== 0) {
546 runText(
547 "/usr/libexec/PlistBuddy",
548 ["-c", `Add :${key} string ${fixtureBundleId}`, plist],
549 {
550 timeoutMs: 60_000,
551 },
552 );
553 }
554}
555
556function shutdownSimulatorIfNeeded(udid) {
557 try {

Callers 1

mainFunction · 0.70

Calls 1

runTextFunction · 0.70

Tested by

no test coverage detected