idb-ui-tap
Tap on iOS screen at specified coordinates with automatic transformation from screenshot space to device space. Supports single, double, and long press gestures. Validates bounds and provides semantic action tracking for test automation.
Instructions
idb-ui-tap
🎯 Tap at coordinates on iOS screen - core UI automation primitive with screenshot coordinate transformation
What it does
Sends precise tap events to iOS targets at specified screen coordinates with automatic coordinate transformation from screenshot space to device space. Supports single tap, double tap, and long press gestures. Validates coordinates against device screen bounds and provides semantic action tracking for test documentation. Works on both simulators and physical devices over USB/WiFi.
Why you'd use it
Automate UI interactions from screenshot analysis - tap elements identified visually
Transform screenshot coordinates automatically when screenshots are resized for token efficiency
Validate tap coordinates against device bounds before execution to prevent out-of-range errors
Track test scenarios with semantic metadata (actionName, expectedOutcome, testScenario, step)
Parameters
Required
x (number): X coordinate (device coords or screenshot coords with applyScreenshotScale)
y (number): Y coordinate (device coords or screenshot coords with applyScreenshotScale)
Optional
udid (string): Target identifier - auto-detects if omitted
numberOfTaps (number, default: 1): Number of taps (set 2 for double-tap)
duration (number): Long press duration in milliseconds
applyScreenshotScale (boolean): Transform screenshot coords to device coords
screenshotScaleX (number): Scale factor for X axis from screenshot-inline
screenshotScaleY (number): Scale factor for Y axis from screenshot-inline
actionName (string): Semantic action name (e.g., "Login Button Tap")
screenContext (string): Screen name for context (e.g., "LoginScreen")
expectedOutcome (string): Expected result (e.g., "Navigate to HomeScreen")
testScenario (string): Test scenario name (e.g., "Happy Path Login")
step (number): Step number in test workflow
Returns
Tap execution status with transformed coordinates, input coordinate details (if transformed), action context metadata for test tracking, error details if failed, and verification guidance.
Examples
Tap from screenshot coordinates (auto-transformed)
const result = await idbUiTapTool({
x: 150, y: 300,
applyScreenshotScale: true,
screenshotScaleX: 2.0, screenshotScaleY: 2.0,
actionName: "Login Button Tap",
expectedOutcome: "Navigate to HomeScreen"
});Related Tools
idb-ui-describe: Discover tappable elements and their coordinates
screenshot: Capture screenshot to identify tap targets
idb-ui-gesture: For swipes and hardware buttons
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | ||
| x | Yes | ||
| y | Yes | ||
| numberOfTaps | No | ||
| duration | No | ||
| applyScreenshotScale | No | ||
| screenshotScaleX | No | ||
| screenshotScaleY | No | ||
| actionName | No | ||
| screenContext | No | ||
| expectedOutcome | No | ||
| testScenario | No | ||
| step | No |