start_screen_record
Initiate screen recording on Android devices for UI testing, debugging, and visual QA workflows. Record up to 180 seconds with background operation.
Instructions
Start recording the screen. Max duration is 180 seconds.
Recording runs in background - use stop_screen_record to stop early.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| duration_seconds | No | ||
| filename | No | recording | |
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:188-210 (handler)The handler function decorated with @mcp.tool() that implements the start_screen_record tool. It launches screenrecord in the background on the device with a configurable duration and filename, returning the remote path of the recording.@mcp.tool() def start_screen_record( duration_seconds: int = 30, filename: str = "recording", device_serial: str | None = None ) -> str: """ Start recording the screen. Max duration is 180 seconds. Recording runs in background - use stop_screen_record to stop early. """ duration = min(duration_seconds, 180) timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") remote_path = f"/sdcard/{filename}_{timestamp}.mp4" # Start recording in background run_adb([ "shell", "nohup", "screenrecord", "--time-limit", str(duration), remote_path, "&" ], device_serial) return f"Recording started: {remote_path} (max {duration}s). Use stop_screen_record to stop early."