android_start_scrcpy_stream
Start continuous fast frame capture from Android devices using scrcpy for screen streaming and control.
Instructions
Start scrcpy streaming for continuous fast frame capture (requires scrcpy installed)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceSerial | No | Specific device serial number to target (optional) |
Implementation Reference
- src/handlers.ts:562-579 (handler)The core handler function for the 'android_start_scrcpy_stream' tool. It extracts arguments, calls adb.startScrcpyStream, and returns success or error response.
export async function handleStartScrcpyStream(adb: ADBWrapper, args: StartScrcpyStreamArgs): Promise<{ content: Array<{ type: string; text: string }> }> { const { deviceSerial } = args; try { await adb.startScrcpyStream(deviceSerial); return { content: [ { type: 'text', text: 'Scrcpy streaming started successfully. Use getLatestFrame to retrieve frames.', }, ], }; } catch (error) { throw new Error(`Failed to start scrcpy stream: ${error instanceof Error ? error.message : String(error)}`); } } - src/index.ts:352-364 (schema)The input schema definition for the tool, registered in the listTools handler.
{ name: 'android_start_scrcpy_stream', description: 'Start scrcpy streaming for continuous fast frame capture (requires scrcpy installed)', inputSchema: { type: 'object', properties: { deviceSerial: { type: 'string', description: 'Specific device serial number to target (optional)', }, }, }, }, - src/index.ts:494-495 (registration)The switch case that registers and dispatches the tool call to the handler function.
case 'android_start_scrcpy_stream': return await handleStartScrcpyStream(this.adb, args as any); - src/handlers.ts:558-560 (schema)TypeScript interface defining the input arguments for the handler, matching the tool schema.
interface StartScrcpyStreamArgs { deviceSerial?: string; }