Skip to main content

HitTest

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Ask the platform's own hit test, below accessibility, whether a touch at the point app_tap would use reaches the target — and if not, what it would reach. These call app_hit_test.

HitTest​

public IDictionary<string, object?> HitTest(string target)

Asks UIKit's own hit test, below accessibility, whether a tap on the target would reach it. Throws when the touch would go elsewhere, naming what would take it and whether accessibility can see it. iOS only, and opt-in: it attaches lldb to the app, about two seconds on a simulator and nine on an iPhone, where the app must be a development build.

Examples​

Ask where a tap on an element would really land​

var hit = device.HitTest("testid=submit");
Console.WriteLine(hit["reaches"]);