Skip to content

Targeted Recording Stop: Track Child PID and Kill Only That Process #20

@joshuayoes

Description

@joshuayoes

Description

🧐 What & Why

stop_recording uses

pkill -SIGINT -f "simctl.*recordVideo"

This can terminate other users’ or unrelated simctl recordVideo sessions, causing data loss and confusion.

🛠️ Proposal

  1. When spawning xcrun … recordVideo, capture the returned ChildProcess object and store child.pid in a Map keyed by UDID (or a singleton if only one recording allowed).
  2. Replace pkill with process.kill(savedPid, 'SIGINT').
  3. If no PID is stored, return an error:
    No recording is currently running.
    

✅ Acceptance Criteria

  • record_video saves its own PID.
  • stop_recording signals only that PID.
  • Unit tests verify PID storage and targeted kill.
  • Legacy pkill code removed.

⚠️ Notes

If multiple recordings per UDID are later supported, extend the map to hold arrays of PIDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions