Skip to content

CLI: snapshot-ui crashes in text output mode — missing cliTool for tap_coordinate next step #226

@dpearson2699

Description

@dpearson2699

Description

xcodebuildmcp ui-automation snapshot-ui crashes when using the default text output format. The snapshot itself succeeds, but the CLI renderer throws when formatting the "next steps" section because the tap_coordinate tool entry is missing a cliTool mapping.

Version

xcodebuildmcp@2.0.7
node v24.13.0
macOS

Steps to Reproduce

  1. Boot a simulator
  2. Launch any app
  3. Run:
    xcodebuildmcp ui-automation snapshot-ui --simulator-id <UDID>

Expected Behavior

The UI hierarchy prints successfully with suggested next steps.

Actual Behavior

Exit code 1 with:

Error: Next step for tool 'tap_coordinate' is missing cliTool - ensure enrichNextStepsForCli was called
    at formatNextStepForCli (…/next-steps-renderer.js:6:11)
    at renderNextStep (…/next-steps-renderer.js:41:41)
    at …/next-steps-renderer.js:49:62
    at Array.map (<anonymous>)
    at renderNextStepsSection (…/next-steps-renderer.js:49:24)
    at processToolResponse (…/next-steps-renderer.js:60:28)
    at printToolResponse (…/cli/output.js:8:21)
    at Object.handler (…/cli/register-tool-commands.js:120:7)

Workaround

Using --output json bypasses the text renderer and returns the hierarchy successfully:

xcodebuildmcp ui-automation snapshot-ui --simulator-id <UDID> --output json

Root Cause (likely)

In next-steps-renderer.js, formatNextStepForCli expects every next-step tool to have a cliTool property. The tap_coordinate entry returned by snapshot-ui is missing this mapping — it wasn't added in enrichNextStepsForCli.

The fix is likely adding cliTool: "tap" (or the correct CLI command name) to the tap_coordinate tool mapping in the enrichment step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions