Skip to main content
Glama

long_press

Simulate long press gestures on Android devices by specifying screen coordinates and duration for UI testing and interaction automation.

Instructions

Long press at coordinates for specified duration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
duration_msNo
device_serialNo

Implementation Reference

  • The handler function for the 'long_press' tool. It simulates a long press by performing an ADB swipe gesture from (x,y) to (x,y) for the specified duration_ms milliseconds. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool() def long_press(x: int, y: int, duration_ms: int = 1000, device_serial: str | None = None) -> str: """Long press at coordinates for specified duration""" return run_adb([ "shell", "input", "swipe", str(x), str(y), str(x), str(y), str(duration_ms) ], device_serial)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rahulkr/r_adb_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server