stop_recording
Stop the active video recording on an iOS simulator by terminating the recording process.
Instructions
Stops the simulator video recording using killall
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1061-1097 (handler)The 'stop_recording' tool handler that sends SIGINT to kill the simctl recordVideo process and stops the recording.
if (!isToolFiltered("stop_recording")) { server.tool( "stop_recording", "Stops the simulator video recording using killall", {}, { title: "Stop Recording", readOnlyHint: false, openWorldHint: true }, async () => { try { await run("pkill", ["-SIGINT", "-f", "simctl.*recordVideo"]); // Wait a moment for the video to finalize await new Promise((resolve) => setTimeout(resolve, 1000)); return { isError: false, content: [ { type: "text", text: "Recording stopped successfully.", }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error stopping recording: ${toError(error).message}` ), }, ], }; } } ); - src/index.ts:1061-1098 (registration)Registration of the 'stop_recording' tool on the MCP server, guarded by a filter check.
if (!isToolFiltered("stop_recording")) { server.tool( "stop_recording", "Stops the simulator video recording using killall", {}, { title: "Stop Recording", readOnlyHint: false, openWorldHint: true }, async () => { try { await run("pkill", ["-SIGINT", "-f", "simctl.*recordVideo"]); // Wait a moment for the video to finalize await new Promise((resolve) => setTimeout(resolve, 1000)); return { isError: false, content: [ { type: "text", text: "Recording stopped successfully.", }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error stopping recording: ${toError(error).message}` ), }, ], }; } } ); } - src/index.ts:1063-1065 (schema)Schema definition: the tool takes no parameters (empty object) and has a description about stopping recording using killall.
"stop_recording", "Stops the simulator video recording using killall", {}, - src/index.ts:77-93 (helper)Helper 'run' function used to execute pkill to stop the recording process.
async function run( cmd: string, args: string[], options: RunOptions = {} ): Promise<{ stdout: string; stderr: string }> { const mergedEnv = options.env ? { ...process.env, ...options.env } : process.env; const { stdout, stderr } = await execFileAsync(cmd, args, { shell: false, env: mergedEnv, }); return { stdout: stdout.trim(), stderr: stderr.trim(), }; }