Skip to main content
Glama

adb_shell

Execute ADB shell commands on Android devices to automate tasks, inspect system information, and control device functionality through direct command-line access.

Instructions

Run an arbitrary ADB shell command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesShell command to execute on the device
device_idNoDevice ID (optional if only one device)

Implementation Reference

  • Registration and implementation handler for the 'adb_shell' tool in index.ts. It calls the adb.shell method.
    server.tool(
      "adb_shell",
      "Run an arbitrary ADB shell command",
      {
        command: z.string().describe("Shell command to execute on the device"),
        device_id: z.string().optional().describe("Device ID (optional if only one device)"),
      },
      async ({ command, device_id }) => {
        const output = await adb.shell(command, device_id);
        return { content: [{ type: "text", text: output || "(no output)" }] };
      },
    );
  • The actual implementation of the shell command execution in the ADB client class.
    async shell(command: string, deviceId?: string): Promise<string> {
      return this.exec(["shell", command], deviceId);
    }

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/martingeidobler/android-mcp-server'

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