Type something to search...

Longarm Docs

This page is the quick entry point for longarm documentation. Use these pages when you need to control an Android device from a script, desktop tool, test harness, or MCP-compatible agent.

Docs pages

What longarm does

longarm runs on an Android device and exposes:

  • an HTTP REST API for direct remote control
  • a streamable HTTP MCP server for agent and tool workflows
  • saved and reusable batch tasks

Main supported actions include:

  • tap and long press
  • Plus gestures such as swipe, pinch, two-finger swipe, and rotate
  • screenshots
  • app launch and custom Android intents
  • optional UI inspection and semantic UI actions

First-time setup

  1. Install and open longarm.
  2. Enable the Android Accessibility Service for longarm.
  3. Allow overlay permission if you want the floating bubble.
  4. In Settings, review the HTTP port, MCP port, bearer-token authentication, bind address, and UI inspection options.
  5. Start the HTTP server and/or MCP server from the app.

Security model

  • By default, longarm expects Authorization: Bearer <token>.
  • If authentication is disabled, anyone on the reachable network can call the server.
  • UI inspection is only available when bearer-token authentication remains enabled and Allow UI inspection is turned on.

REST API

The HTTP server exposes endpoints under /api/... for gestures, screenshots, app launching, Android intents, UI inspection, and batch automation.

Read the REST API docs.

MCP

longarm also exposes a streamable HTTP MCP server so compatible agents and tools can call Android control actions directly.

Read the MCP docs.

Batch tasks

Batch tasks save reusable multi-step Android automation flows that can run from the app, REST API, or MCP.

Read the batch task docs.

Detailed logs and history

longarm separates REST/MCP request logs from batch-run history so you can inspect both low-level calls and complete workflow runs.

Read the logs and history docs.

  1. Start the HTTP or MCP server.
  2. Copy the host and port shown in the app.
  3. Use the REST API for direct scripts, or MCP for agent integration.
  4. Save repeated flows as batch tasks.
  5. Check the Logs tab and Batch History tab inside longarm.