Skip to content

Sessions are keyed by cwd and bound to one device, so driving iOS and Android from one checkout needs hand-named --session on every command #2580

Description

@JKobrynski

agent-device 0.21.0, macOS, Node 24.18. Found while driving iOS and Android from one checkout for a visual regression PoC (callstack/react-native-paper#5115).

Sessions are keyed by cwd and bound to the first device they touch. After open … --platform ios --udid … from a directory, running boot --platform android --device Pixel_10_Pro from the same directory fails:

INVALID_ARGS: … already bound to apple device "iPhone 17 Pro" … but this request selected --platform=android

The hint (pass a different --session) is correct and --session android works. But a repo that tests both platforms then has to invent and thread session names by hand through every command, and a script that forgets one flag silently talks to the wrong device. Two smaller consequences of the same design:

  • a leftover session from an earlier run in a repo root kept the wrong simulator bound; the workaround was to run from a different directory rather than close a session another process might own;
  • when this script itself ran under npx -p node@20 node …, the nested npx agent-device inherited npm_config_package and installed node instead. Unrelated to sessions but the same class: environment leaking into what the CLI resolves.

Suggestion: key sessions by cwd + platform by default, or make --platform select a per-platform default session so the common two-platform case needs no naming.

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