simulator.record_video.start
Start recording video of the iOS Simulator screen for React Native/Expo development testing and debugging.
Instructions
Start recording video of the simulator screen
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name prefix for the video file. | recording |
Implementation Reference
- src/simulator/video.ts:21-61 (handler)Core implementation of the video recording start logic using simctl's recordVideo command.export async function startVideoRecording(name: string = "recording"): Promise<VideoRecordingInfo> { logger.info("simulator", `Starting video recording: ${name}`); if (recordingProcess) { throw createError("SIMCTL_FAILED", "Video recording is already in progress", { details: `Current recording: ${currentVideoPath}`, }); } // Check if simulator is booted if (!stateManager.isSimulatorReady()) { const bootedDevice = await getBootedDevice(); if (!bootedDevice) { throw createError("SIM_NOT_BOOTED", "No simulator is currently booted", { details: "Boot a simulator first using simulator.boot", }); } stateManager.updateSimulator({ state: "booted", udid: bootedDevice.udid, deviceName: bootedDevice.name, }); } currentVideoPath = await artifactManager.getVideoPath(name); // Start recording in the background recordingProcess = execa("xcrun", ["simctl", "io", "booted", "recordVideo", currentVideoPath], { reject: false, }); const startedAt = new Date().toISOString(); logger.info("simulator", `Video recording started: ${currentVideoPath}`); return { isRecording: true, path: currentVideoPath, startedAt, }; }
- src/mcp/server.ts:188-207 (registration)MCP tool registration, including thin wrapper handler that calls the core startVideoRecording function.server.tool( "simulator.record_video.start", "Start recording video of the simulator screen", VideoRecordingInputSchema.shape, async (args) => { try { const result = await startVideoRecording(args.name); return { content: [ { type: "text", text: JSON.stringify({ success: true, ...result }, null, 2), }, ], }; } catch (error) { return handleToolError(error); } } );
- src/mcp/schemas.ts:32-34 (schema)Zod schema defining input parameters for the tool (optional name with default).export const VideoRecordingInputSchema = z.object({ name: z.string().optional().default("recording").describe("Name prefix for the video file."), });