Skip to content

test_sim hides xcodebuild simulator Accessibility destination timeout details #431

@dpearson2699

Description

@dpearson2699

Summary

test_sim can return a generic failed tool result when xcodebuild times out while resolving a simulator destination, but the most actionable lines from xcodebuild are only obvious in the MCP JSONL log. In an agent workflow this looked like the test run had stalled, even though the MCP call eventually returned success: false after its internal timeout.

This is not a project-specific compile/test failure. The tests never started because xcodebuild could not finish loading the requested simulator destination.

Environment

From doctor:

XcodeBuildMCP serverVersion: 2.5.2
Xcode: Xcode 26.5 - Build version 17F42 (/Applications/Xcode.app/Contents/Developer)
process-tree: Running under Xcode: No
axe: Available: Yes; UI automation: Yes; Video capture: Yes
xcodemake: Enabled: No; Binary: No
mise: Running under mise: No; Available: No
debugger-dap: Selected backend: lldb-cli; lldb-dap available: Yes
manifest-tools: Total tools: 79; Workflows: 15
runtime-registration: Registered tools: 55
xcode-ide-bridge: Workflow enabled: Yes; Connected: No; Proxied tools: 0
sentry: Enabled: Yes

Host:

macOS/Darwin 25.5.0

Sanitized tool request

The original project/scheme/test names were private, so this is the same shape with identifiers sanitized:

{
  "name": "test_sim",
  "arguments": {
    "extraArgs": [
      "-only-testing:ExampleAppTests/ExampleFeatureTests",
      "-only-testing:ExampleAppTests/ExampleServiceTests",
      "-only-testing:ExampleAppTests/ExampleRegressionTests"
    ],
    "progress": true
  }
}

Session defaults were set to a concrete iOS Simulator UUID destination. The actual simulator UUID is also omitted here, but the generated xcodebuild command used a destination of this form:

-destination id=<IOS_SIMULATOR_UUID>

Observed behavior

The MCP call returned a failed result after about 130 seconds:

{
  "success": false,
  "durationMs": 129998
}

The actionable underlying error was present in the MCP log, but easy to miss from the summarized tool result:

xcodebuild: error: Unable to find a device matching the provided destination specifier:
        { platform:iOS Simulator, id:<IOS_SIMULATOR_UUID> }

The requested device could not be found because it timed out while loading.

The raw xcodebuild output in the MCP log also included:

[MT] IDERunDestination: Timed out while loading Accessibility

And the available destinations list did not include the requested simulator at that moment; it only showed a physical device and the generic simulator placeholder, for example:

Available destinations for the "<sanitized scheme>" scheme:
        { platform:iOS, arch:arm64, id:<PHYSICAL_DEVICE_ID>, name:<physical device name> }
        { platform:iOS Simulator, id:dvtdevice-DVTiPhonePlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }

Why this was hard to diagnose

From the agent side, the important failure mode was not immediately visible: xcodebuild never reached test execution; it failed during simulator destination resolution because Accessibility/device loading timed out.

The root-cause lines were available only after manually inspecting the MCP JSONL logs under the Claude MCP cache directory. That makes the failure easy to misinterpret as an MCP hang or a long-running test run.

Expected behavior

When test_sim fails before tests start because xcodebuild cannot resolve the simulator destination, the tool result should surface the key root-cause lines directly, especially:

IDERunDestination: Timed out while loading Accessibility
The requested device could not be found because it timed out while loading.

Ideally the result would also classify this as a simulator destination/readiness failure rather than a generic test failure.

Possible improvements

  1. Include the last relevant xcodebuild stderr/stdout lines directly in the test_sim failure response when destination resolution fails.

  2. Detect this specific pattern and return a clearer diagnostic, for example:

    xcodebuild timed out loading Accessibility while resolving simulator destination <UUID>. The simulator/device service was not ready; tests did not start.
    
  3. Include the raw build/test log path prominently in the failure response.

  4. Consider exposing a per-call timeout or fail-fast option for test_sim, so agent workflows can bound simulator readiness failures explicitly.

Notes

This report is intentionally sanitized: project name, scheme name, test target names, simulator UUID, device ID, user paths, and app identifiers have been replaced with placeholders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions