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

Function cleanup

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

Source from the content-addressed store, hash-verified

2206}
2207
2208function cleanup() {
2209 if (serverProcess && !serverProcess.killed) {
2210 serverProcess.kill("SIGTERM");
2211 serverProcess = null;
2212 }
2213 killPortListeners(serverPort);
2214 if (simulatorUDID && !keepSimulator) {
2215 spawnSync("xcrun", ["simctl", "shutdown", simulatorUDID], {
2216 stdio: "ignore",
2217 });
2218 spawnSync("xcrun", ["simctl", "delete", simulatorUDID], {
2219 stdio: "ignore",
2220 });
2221 simulatorUDID = "";
2222 } else if (simulatorUDID && keepSimulator) {
2223 console.log(`Keeping integration simulator ${simulatorUDID}`);
2224 simulatorUDID = "";
2225 }
2226 if (fs.existsSync(tempRoot)) {
2227 fs.rmSync(tempRoot, { recursive: true, force: true });
2228 }
2229}
2230
2231function killPortListeners(port) {
2232 const result = spawnSync(

Callers 2

cli.mjsFile · 0.70

Calls 2

logMethod · 0.80
killPortListenersFunction · 0.70

Tested by

no test coverage detected