Skip to main content
Glama
XC-MCP: XCode CLI wrapper

XC-MCP: XCode CLI wrapper

by conorluddy

Perform Gesture / Button Press

idb-ui-gesture

Executes swipes, scrolls, custom gestures, and hardware button presses on iOS targets to automate navigation and UI testing.

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)

Scrolling

operation: scroll uses content direction up/down and amount (default 3, maximum 100). refresh performs one downward pull.

Additional gestures

operation also accepts pinch (startX/startY and positive scale), long-press (startX/startY, duration in milliseconds; default 2000), double-tap (startX/startY, count >= 2), drag (start/end coordinates or source/destination accessibility labels), rotate (orientation: portrait, portrait-upside-down, landscape-left, landscape-right), and shake. Newer operations require a supporting idb CLI and companion.

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "operation": "<operation>"
    },
    "name": "idb-ui-gesture"
  }
}

Input Schema

NameRequiredDescriptionDefault
endXNo
endYNo
udidNo
countNo
scaleNo
amountNo
sourceNo
startXNo
startYNo
durationNoSwipe duration in milliseconds (e.g., 200 for 200ms, default: 200ms)
directionNo
operationYes
actionNameNo
buttonTypeNo
destinationNo
orientationNo
expectedOutcomeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv5.0.0
    • addedInput schema / properties / amount
      Added value: +{
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / count
      Added value: +{
      +  "maximum": 9007199254740991,
      +  "minimum": 2,
      +  "type": "integer"
      +}
    • addedInput schema / properties / destination
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • removedInput schema / properties / duration / default
      Removed value: -200
    • changedInput schema / properties / operation / enum
      Previous value: -[
      -  "swipe",
      -  "button"
      -]New value: +[
      +  "swipe",
      +  "button",
      +  "pinch",
      +  "long-press",
      +  "double-tap",
      +  "drag",
      +  "rotate",
      +  "shake",
      +  "scroll",
      +  "refresh"
      +]
    • addedInput schema / properties / orientation
      Added value: +{
      +  "enum": [
      +    "portrait",
      +    "portrait-upside-down",
      +    "landscape-left",
      +    "landscape-right"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / scale
      Added value: +{
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / source
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Addedv1.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare the safety profile (readOnly=false, destructive=false, idempotent=false, openWorld=false); the description goes well beyond them with velocity validation (>6000 px/sec threshold), coordinate validation against device bounds, POINT vs pixel coordinate space, profile timing/distance values, and the caveat that newer operations require a supporting idb CLI and companion. That is exactly the kind of operational context annotations cannot convey.

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?

Well structured with headings and front-loaded purpose, but bloated: the "Complete JSON Examples" block (11 examples) and the later TypeScript "Examples" block repeat the same calls, and the h1/name echo plus emoji header add little. Much of the length is redundant rather than informative.

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?

For a 17-parameter, multi-operation tool with no output schema, the description covers operations, per-operation parameters, profile tuning, coordinate space, return payload, and error behavior, which is substantial. The remaining gap is the mismatch between the documented `profile`/operation values and the actual schema enum, which leaves ambiguity about what will actually be accepted.

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

Parameters4/5

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

With only 6% schema description coverage, the description carries nearly the full burden and mostly succeeds: it documents operation values, direction, duration units, amount bounds, count, scale, source/destination, orientation, buttonType, and actionName/expectedOutcome. However it is internally inconsistent — "What it does" names profiles as flick/swipe/drag while the Parameters section says standard/flick/gentle, `profile` is documented but absent from the schema, and the Required section narrows operation to "swipe" | "button" while the schema enum and later sections add scroll, refresh, pinch, drag, rotate, shake.

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?

States a specific verb and resource ("Executes swipe gestures ... and hardware button presses on iOS targets") and enumerates the concrete capabilities. The Related Tools section explicitly separates it from idb-ui-tap (element tapping) and idb-ui-describe (finding coordinates), so an agent can route correctly.

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?

A dedicated "Why you'd use it" section gives concrete scenarios (reveal content, dismiss modals, test hardware buttons) and the Swipe Profiles section says which profile to pick for which UI (flick for carousels, gentle for slow scrolling). It never states when NOT to use this tool or what preconditions exist (e.g., app must be foregrounded), so it is strong but not exhaustive.

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