Skip to content

start/stop_screen_recording produces corrupt files on Android and silently fails on iOS physical devices #321

@Cariocecuz

Description

@Cariocecuz

Describe the bug

mobile_start_screen_recording / mobile_stop_screen_recording issue on physical devices for both platforms:

  • Android: start succeeds, stop returns a file path, size, and duration — appearing to work. However, the output MP4 is always corrupt: it's missing the moov atom (the metadata/index header), making it unplayable in any player. ffprobe confirms: moov atom not found — Invalid data found when processing input. Reproduced 4/4 times.

  • iOS: start returns success, but stop returns No active recording found for device — Start a recording first. No file is ever created on disk. Reproduced 2/2 times.

    The same Android device recorded via adb screenrecord produces valid, playable MP4 files 4/4 times, confirming the issue is
    in the MCP tool's stop/finalization logic, not the device.

    Configuration:
    • Agent: Augment Code (Claude)
    • OS: macOS
    • Devices used: Android physical, iOS physical
    • Device versions: Android 14, iOS 26.2
    • Device models: Pixel 7, iPhone 15

    To Reproduce

    Android:

    1. mobile_start_screen_recording with an output path
    2. Interact with the device (tap, swipe, navigate)
    3. mobile_stop_screen_recording — tool reports success with file size and duration
    4. Try to open the file — it's unplayable. ffprobe reports moov atom not found

    iOS:

    1. mobile_start_screen_recording with an output path — tool reports success
    2. Interact with the device
    3. mobile_stop_screen_recording — returns No active recording found for device
    4. No file exists at the output path

    Expected behavior

    A valid, playable MP4 file is saved to the specified path after stop_screen_recording.

    Actual behavior

    • Android: Corrupt MP4 (raw H.264 data present but moov atom never written — container not finalized)
    • iOS: No file created at all; recording state lost between start and stop

    Comparison with ADB (Android baseline — works 4/4):

    Start recording on device
    adb -s <DEVICE_ID> shell screenrecord /sdcard/recording.mp4 --time-limit 120 &

    Stop recording (SIGINT finalizes the mp4 container / writes moov atom)
    adb -s <DEVICE_ID> shell "kill -2 $(adb -s <DEVICE_ID> shell pgrep screenrecord)"

    Wait for finalization
    sleep 3
    Pull file from device
    adb -s <DEVICE_ID> pull /sdcard/recording.mp4 /tmp/recording.mp4

    Remux with faststart flag (moves moov atom to front for compatibility)
    ffmpeg -i /tmp/recording.mp4 -c copy -movflags +faststart output.mp4

    The key difference: ADB's screenrecord properly writes the moov atom when it receives SIGINT (kill -2). The MCP tool's
    stop_screen_recording is not finalizing the MP4 container on Android, and on iOS it loses track of the recording process
    entirely.

    Screenshots
    N/A — the issue is corrupt/missing files, not a visual bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions