Skip to content

iOS: a command on a session whose simulator was deleted waits ~22 s and suggests deleting the shared runner cache #4687

Closed

Description

@xiatiandeairen

Purpose

When a session's simulator is deleted, the next command on that session waits about 22 s and then fails with a generic runner error. This happens, for example, when an external device pool reclaims the simulator, or when someone runs xcrun simctl delete. The real cause, a missing device, appears only in runner.log.

The hint makes it worse. It tells the caller to remove ~/.agent-device/apple-runner/derived. Every session on the host shares that runner cache, so an agent that follows the hint breaks other agents' runs. Agents act on hints literally, so this error needs to name the real cause.

Observed on 0.21.39, iOS 27.2 simulator:

$ agent-device open dev.agentverify.MultiTodo --udid 90A2E165-… --session c39r
# the simulator is deleted about 4 s later
15:33:47 $ agent-device snapshot -i --session c39r
Error (COMMAND_FAILED): Runner did not accept connection (xcodebuild exited early). Not dispatched. Next: Retry runner startup, inspect xcodebuild logs, and verify simulator responsiveness before command execution. If runner build products look stale or corrupted, run `pnpm clean:xcuitest` in a local checkout, or remove ~/.agent-device/apple-runner/derived, then retry.
15:34:09

With --json, details holds only xcodebuild.exitCode: 70.

Required behavior

  • When the session's simulator no longer exists, the command fails fast with a typed error that names the UDID.
  • The error does not suggest deleting the shared runner cache. It points to closing the session instead.

Completion conditions

  • After simctl delete of the session's simulator, the next command fails in under 5 s with DEVICE_NOT_FOUND and details.deviceId.
  • close on that session succeeds.

Fix: #4696.

Out of scope

A session whose simulator is gone also keeps the daemon busy, so a newer CLI can't replace it. That part is the caller's responsibility: close the agent-device session before returning the device. No change to ADR 0006 is needed.

Activity

  1. added
    bug
    on Nov 19, 2026
  2. changed the title [-]iOS: a session whose simulator was deleted waits ~22 s per command, suggests deleting the shared runner cache, and keeps the daemon busy[/-] [+]iOS: a command on a session whose simulator was deleted waits ~22 s and suggests deleting the shared runner cache[/+] on Nov 19, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions