Skip to content

Android record start refuses with "native recovery evidence already exists" on an emulator re-adopted from a previous session #2550

Description

@janicduplessis

What happened

agent-device 0.21.1, Android emulators managed by an external tool that stops, parks and later re-adopts them under a new serial. On the first record start of a new session against a re-adopted emulator:

Android screenrecord native recovery evidence already exists

(internal error, "retry with --debug"). record stop then says "no active recording"; closing and reopening the session does not clear it. Cause: a stale /sdcard/agent-device-recording-active.json left by an earlier session on the same AVD, whose deviceId (the old serial) no longer matches, so the recovery check throws instead of retiring the manifest. Deleting the file by hand (adb shell rm /sdcard/agent-device-recording-active.json) fixes it.

Seen on three separate runs in two days, whenever an emulator changed serial between sessions. The failure is also easy to miss: with default output the last line is Session state: ... and the error is only in the request ndjson, so the run continues unrecorded.

Proposal

When the manifest's deviceId does not match the current serial, or its session is no longer registered, retire the manifest and start the recording; and print the refusal on stdout so a caller sees it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions