Skip to content

context deadline exceeded on mobile_click_on_screen_at_coordinates and mobile_list_elements_on_screen when screen contains large accessibility tree (iOS simulator) #288

@pawelkw

Description

@pawelkw

Summary

On iOS simulator, any interaction via mobile_click_on_screen_at_coordinates or mobile_list_elements_on_screen fails with context deadline exceeded when the current screen contains
a large number of UI elements (e.g. a scrollable list with hundreds of rows). mobile_take_screenshot is unaffected.

Environment

  • mobile-mcp version: latest (npx)
  • Platform: iOS simulator
  • Device: iPhone 17 Pro simulator, iOS 26.1
  • Host OS: macOS Darwin 25.3.0 (Apple Silicon)
  • App under test: Native iOS app with a UITableView station-selection screen (~300+ rows)

Steps to Reproduce

  1. Launch an iOS app that displays a long scrollable list (e.g. a UITableView with 200+ rows)
  2. Call mobile_list_elements_on_screen — observe timeout
  3. Call mobile_click_on_screen_at_coordinates at any coordinate on the same screen — observe timeout

Errors Observed

mobile_list_elements_on_screen:
failed to dump UI from device XXXX-XXXX-XXXX-XXXX-XXXXXX: failed to get source:
failed to fetch endpoint source?format=json&excluded_attributes=:
Get "http://localhost:13001/source?format=json&excluded_attributes=": context deadline exceeded

mobile_click_on_screen_at_coordinates:
failed to tap on device XXXX-XXXX-XXXX-XXXX-XXXXXX:
failed to post to endpoint session/xxxxxxxxxx/actions:
Post "http://localhost:13001/session/.../actions": context deadline exceeded

Expected Behaviour

  • mobile_list_elements_on_screen either returns a paginated/truncated result or increases its timeout to handle large trees
  • mobile_click_on_screen_at_coordinates performs a coordinate-based tap without requiring a full accessibility tree traversal — the tap should succeed regardless of list size

Actual Behaviour

Both calls hang and then fail. The WDA process (PID visible on port 13001) enters a broken state where it accepts new connections but all subsequent requests also time out,
requiring the process to be killed manually.

mobile_take_screenshot continues to work on the same screen, confirming the simulator and WDA process are alive — the issue is specifically with the accessibility tree endpoints.

Workaround

  • Avoid mobile_list_elements_on_screen on large-list screens; use mobile_take_screenshot instead
  • Use a search/filter input to reduce the list to a small number of items before attempting mobile_click_on_screen_at_coordinates
  • Kill the WDA process (kill -9 ) after a timeout to restore functionality on other screens

Suggested Fix

For mobile_click_on_screen_at_coordinates: send the tap as a W3C Actions API pointer event at the given coordinates without first fetching the accessibility tree. The coordinates
are already known — no element lookup should be required.

For mobile_list_elements_on_screen: consider adding a snapshotMaxDepth cap to the WDA source request, as recommended in the
https://appium.github.io/appium-xcuitest-driver/latest/guides/wda-slowness/.

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