xc-mcp
Version:
MCP server that wraps Xcode command-line tools for iOS/macOS development workflows
71 lines • 5.83 kB
TypeScript
interface IdbUiTapArgs {
udid?: string;
x: number;
y: number;
numberOfTaps?: number;
duration?: number;
applyScreenshotScale?: boolean;
screenshotScaleX?: number;
screenshotScaleY?: number;
actionName?: string;
screenContext?: string;
expectedOutcome?: string;
testScenario?: string;
step?: number;
}
/**
* 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:**
* - x, y (required): Tap coordinates - device coords or screenshot coords with applyScreenshotScale
* - udid (optional): Target identifier - auto-detects if omitted
* - numberOfTaps (optional): Default 1, set 2 for double-tap
* - duration (optional): Long press duration in milliseconds
* - applyScreenshotScale (optional): Transform screenshot coords to device coords
* - screenshotScaleX, screenshotScaleY (optional): Scale factors from screenshot-inline
* - actionName, screenContext, expectedOutcome, testScenario, step (optional): Semantic tracking
*
* **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.
*
* **Example:**
* ```typescript
* // 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"
* });
* ```
*
* **Full documentation:** See idb/ui-tap.md for detailed parameters and coordinate systems
*
* @param args Tool arguments with coordinates and optional transformation parameters
* @returns Tool result with tap status and coordinate transformation details
*/
export declare function idbUiTapTool(args: IdbUiTapArgs): Promise<{
content: {
type: "text";
text: string;
}[];
isError: boolean;
}>;
export declare const IDB_UI_TAP_DOCS = "\n# idb-ui-tap\n\n\uD83C\uDFAF **Tap at coordinates on iOS screen** - core UI automation primitive with screenshot coordinate transformation\n\n## What it does\n\nSends 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.\n\n## Why you'd use it\n\n- Automate UI interactions from screenshot analysis - tap elements identified visually\n- Transform screenshot coordinates automatically when screenshots are resized for token efficiency\n- Validate tap coordinates against device bounds before execution to prevent out-of-range errors\n- Track test scenarios with semantic metadata (actionName, expectedOutcome, testScenario, step)\n\n## Parameters\n\n### Required\n- **x** (number): X coordinate (device coords or screenshot coords with applyScreenshotScale)\n- **y** (number): Y coordinate (device coords or screenshot coords with applyScreenshotScale)\n\n### Optional\n- **udid** (string): Target identifier - auto-detects if omitted\n- **numberOfTaps** (number, default: 1): Number of taps (set 2 for double-tap)\n- **duration** (number): Long press duration in milliseconds\n- **applyScreenshotScale** (boolean): Transform screenshot coords to device coords\n- **screenshotScaleX** (number): Scale factor for X axis from screenshot-inline\n- **screenshotScaleY** (number): Scale factor for Y axis from screenshot-inline\n- **actionName** (string): Semantic action name (e.g., \"Login Button Tap\")\n- **screenContext** (string): Screen name for context (e.g., \"LoginScreen\")\n- **expectedOutcome** (string): Expected result (e.g., \"Navigate to HomeScreen\")\n- **testScenario** (string): Test scenario name (e.g., \"Happy Path Login\")\n- **step** (number): Step number in test workflow\n\n## Returns\n\nTap execution status with transformed coordinates, input coordinate details (if transformed), action context metadata for test tracking, error details if failed, and verification guidance.\n\n## Examples\n\n### Tap from screenshot coordinates (auto-transformed)\n```typescript\nconst result = await idbUiTapTool({\n x: 150, y: 300,\n applyScreenshotScale: true,\n screenshotScaleX: 2.0, screenshotScaleY: 2.0,\n actionName: \"Login Button Tap\",\n expectedOutcome: \"Navigate to HomeScreen\"\n});\n```\n\n## Related Tools\n\n- idb-ui-describe: Discover tappable elements and their coordinates\n- screenshot: Capture screenshot to identify tap targets\n- idb-ui-gesture: For swipes and hardware buttons\n";
export declare const IDB_UI_TAP_DOCS_MINI = "Tap at coordinates on iOS screen. Use rtfm({ toolName: \"idb-ui-tap\" }) for docs.";
export {};
//# sourceMappingURL=ui-tap.d.ts.map