Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Perform Gesture / Button Press

idb-ui-gesture

Perform swipe gestures and hardware button presses on iOS simulators to automate navigation and test hardware interactions like home, lock, and screenshots.

Instructions

idb-ui-gesture

šŸ‘† Perform gestures and hardware button presses - swipes, scrolls, and device controls for navigation

What it does

Executes swipe gestures (directional or custom paths) and hardware button presses on iOS targets. Supports standard swipe directions (up, down, left, right) with automatic screen-relative path calculation using configurable profiles (flick, swipe, drag), custom swipe paths with precise start/end coordinates, and hardware button simulation (HOME, LOCK, SIRI, SCREENSHOT, APP_SWITCH). Automatically validates velocity to ensure iOS recognizes gestures as swipes (>6000 px/sec). Validates coordinates against device bounds and provides semantic action tracking.

Why you'd use it

  • Automate scroll and navigation gestures - swipe to reveal content, dismiss modals, page through carousels

  • Use optimized swipe profiles for different UIs - flick for fast page changes, swipe for standard scrolling, drag for slow interactions

  • Test hardware button interactions without physical device access - home button, lock, app switching

  • Execute precise custom swipe paths for complex gesture-based UIs (drawing, map navigation)

  • Track gesture-based test scenarios with semantic metadata (actionName, expectedOutcome)

Parameters

Required

  • operation (string): "swipe" | "button"

Swipe operation parameters

  • direction (string): "up" | "down" | "left" | "right" - auto-calculates screen-relative path

  • profile (string, default: "standard"): "standard" | "flick" | "gentle" - gesture profile

  • startX, startY, endX, endY (numbers): Precise POINT coordinates for custom swipe path

  • duration (number, default: 200): Swipe duration in MILLISECONDS (e.g., 200 for 200ms) - uses profile default if omitted

Button operation parameters

  • buttonType (string): "HOME" | "LOCK" | "SIDE_BUTTON" | "APPLE_PAY" | "SIRI" | "SCREENSHOT" | "APP_SWITCH"

Optional

  • udid (string): Target identifier - auto-detects if omitted

  • actionName (string): Semantic action name (e.g., "Scroll to Bottom")

  • expectedOutcome (string): Expected result (e.g., "Reveal footer content")

Swipe Profiles (Empirically Tested)

  • standard: Default balance (75% distance, 200ms, 1475 points/sec) - perfect for general navigation

  • flick: Fast page changes (85% distance, 120ms, 2775 points/sec) - use for carousel/rapid navigation

  • gentle: Slow scrolling (50% distance, 300ms, 653 points/sec) - reliable but near-minimum threshold

All coordinates in POINT space (393Ɨ852 for iPhone 16 Pro), NOT pixel space. All profiles tested and verified working on iOS 18.5 home screen.

Complete JSON Examples

Swipe Up (Scroll Down)

{"operation": "swipe", "direction": "up", "profile": "standard", "actionName": "Scroll Down"}

Swipe Down (Scroll Up)

{"operation": "swipe", "direction": "down", "profile": "standard", "actionName": "Scroll Up"}

Swipe Left (Navigate Forward)

{"operation": "swipe", "direction": "left", "profile": "standard", "actionName": "Go to Next Page"}

Swipe Right (Navigate Back)

{"operation": "swipe", "direction": "right", "profile": "standard", "actionName": "Go to Previous Page"}

Flick Swipe (Fast Page Navigation)

{"operation": "swipe", "direction": "left", "profile": "flick", "duration": 120, "actionName": "Fast Swipe to Next"}

Gentle Swipe (Slow Scrolling)

{"operation": "swipe", "direction": "up", "profile": "gentle", "duration": 300, "actionName": "Slow Scroll Down"}

Custom Swipe Path (Precise Coordinates)

{"operation": "swipe", "startX": 196, "startY": 600, "endX": 196, "endY": 200, "duration": 200, "actionName": "Custom Scroll"}

Press Home Button

{"operation": "button", "buttonType": "HOME", "actionName": "Background App"}

Press Lock Button

{"operation": "button", "buttonType": "LOCK", "actionName": "Lock Device"}

Press Side Button

{"operation": "button", "buttonType": "SIDE_BUTTON", "actionName": "Trigger Side Button Action"}

Press Siri Button

{"operation": "button", "buttonType": "SIRI", "actionName": "Activate Siri"}

Press Screenshot Button

{"operation": "button", "buttonType": "SCREENSHOT", "actionName": "Capture Screenshot"}

Press App Switch Button

{"operation": "button", "buttonType": "APP_SWITCH", "actionName": "Show App Switcher"}

Returns

Gesture execution status with operation details (direction/button, path coordinates for swipes), duration, velocity info, gesture context metadata, error details if failed, and verification guidance.

Examples

Standard swipe up (default profile)

const result = await idbUiGestureTool({
  operation: 'swipe',
  direction: 'up',
  actionName: 'Scroll to Bottom',
  expectedOutcome: 'Reveal footer content'
});

Flick swipe for fast page navigation

await idbUiGestureTool({
  operation: 'swipe',
  direction: 'left',
  profile: 'flick',
  actionName: 'Go to Next Page'
});

Press home button

await idbUiGestureTool({ operation: 'button', buttonType: 'HOME' });
  • idb-ui-tap: For precise element tapping

  • idb-ui-describe: Find element coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endXNo
endYNo
udidNo
startXNo
startYNo
durationNoSwipe duration in milliseconds (e.g., 200 for 200ms, default: 200ms)
directionNo
operationYes
actionNameNo
buttonTypeNo
expectedOutcomeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only indicate non-read-only, non-destructive, and non-idempotent behavior, which is minimal. The description adds that velocity is validated and coordinates are checked against device bounds, but it does not clearly disclose side effects (e.g., launching gestures actually changes UI states) or limitations beyond what the annotations imply. With annotations providing little content, the description should carry more weight, and it does not fully disclose the real-world impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with headings and tables but is progressively verbose. 'Complete JSON Examples' and the later 'Examples' section repeat nearly the same information in different syntax, and some sections (like full JSON examples for every button type) are redundant. Each piece has value, but the description could be tightened without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 11 parameters and no output schema, yet the description covers all parameter meanings, coordinates, profiles, return contents, and provides error examples. It matches the tool's complexity well. The only gap is the lack of more precise output format descriptions, but since no output schema exists, the returned description is reasonable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 9%, so the description this must compensate. It does so admirably: it details the operation parameter, defines profile values and their measured speeds, explains coordinate space (POINT vs PIXEL), gives defaults for duration, and lists button types. Extensive examples illustrate how parameters combine, which goes far beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs swipe gestures and hardware button presses on iOS targets, using specific verbs and resources. It differentiates itself from sibling tools by naming related tools like idb-ui-tap and idb-ui-describe, making its unique purpose clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Why you'd use it' section provides specific scenarios, and 'Related Tools' names alternatives for tapping and describing elements. However, it does not explicitly state when not to use this tool or provide exclusion criteria, so it stops short of full when-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.