MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / stopSession

Function stopSession

src/utils/video_capture.ts:87–121  ·  view source on GitHub ↗
(
  simulatorUuid: string,
  options: { timeoutMs?: number } = {},
)

Source from the content-addressed store, hash-verified

85type StopSessionResult = StopSessionSuccess | StopSessionError;
86
87async function stopSession(
88 simulatorUuid: string,
89 options: { timeoutMs?: number } = {},
90): Promise<StopSessionResult> {
91 const session = sessions.get(simulatorUuid);
92 if (!session) {
93 return { error: 'No active video recording session for this simulator' };
94 }
95
96 sessions.delete(simulatorUuid);
97 const child = session.process as ChildProcess | undefined;
98
99 try {
100 child?.kill?.('SIGINT');
101 } catch {
102 try {
103 child?.kill?.();
104 } catch {
105 // ignore
106 }
107 }
108
109 await waitForChildToStop(session, options.timeoutMs ?? 5000);
110
111 const combinedOutput = session.buffer;
112 const parsedPath = parseLastAbsoluteMp4Path(combinedOutput) ?? undefined;
113
114 session.releaseActivity?.();
115
116 return {
117 sessionId: session.sessionId,
118 stdout: combinedOutput,
119 parsedPath,
120 };
121}
122
123function ensureSignalHandlersAttached(): void {
124 if (signalHandlersAttached) return;

Callers 3

stopAllFunction · 0.85

Calls 4

waitForChildToStopFunction · 0.85
parseLastAbsoluteMp4PathFunction · 0.85
getMethod · 0.80
killMethod · 0.65

Tested by

no test coverage detected