Skip to content

Device panel: a physical device is lent to one thread at a time; simulators per thread #163

Open

Description

@immakermatty

Problem

The Device panel opens an iOS Simulator or Android Emulator for a thread (device_open, pinned agent-device CLI). A device host can also have a physical phone attached over USB. A simulator can be cloned per thread, but a physical device is one screen, one input and one installed app state.

If two threads open the same physical device, they step on each other: one installs a build while the other taps through a flow. Nothing in the tools prevents that today, so the only guard would be agents agreeing in chat. We are removing that kind of coordination (threads must work independently).

Proposal

  • A physical device is lent to one thread at a time. device_open on a device held by another thread fails with a clear reason (holder thread, since when) instead of attaching.
  • The lease ends when the thread closes the device or ends; a stale lease expires.
  • device_list shows the holder.
  • Simulators and emulators stay per thread. Where a host can, device_open without a deviceId gives the thread its own clone, so parallel threads never share one.

Acceptance

  • Two threads open the same physical device: the second gets a refusal naming the holder; after the first closes it, the second succeeds.
  • Two threads open "an iOS simulator": each gets its own device.

🤖 Generated with Claude Code

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