Skip to main content
Glama

install_apk

Install APK files on Android devices using ADB commands. Specify the local APK file path and optional device ID to deploy applications to connected devices.

Instructions

Install an APK file on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apk_pathYesLocal path to the APK file
device_idNoDevice ID (optional if only one device)

Implementation Reference

  • The `installApk` method in the `Adb` class, which handles the execution of the `adb install -r` command to install an APK file on a device.
    async installApk(apkPath: string, deviceId?: string): Promise<string> {
      const fullArgs = deviceId ? ["-s", deviceId, "install", "-r", apkPath] : ["install", "-r", apkPath];
      const { stdout } = await execFileAsync(this.adbPath, fullArgs, {
        timeout: 60_000,
        maxBuffer: 10 * 1024 * 1024,
      });
      return stdout;
    }
  • src/index.ts:473-484 (registration)
    Registration of the `install_apk` tool, which maps the input arguments to the `adb.installApk` method call.
    server.tool(
      "install_apk",
      "Install an APK file on the device",
      {
        apk_path: z.string().describe("Local path to the APK file"),
        device_id: z.string().optional().describe("Device ID (optional if only one device)"),
      },
      async ({ apk_path, device_id }) => {
        const result = await adb.installApk(apk_path, device_id);
        return { content: [{ type: "text", text: result.trim() }] };
      },
    );

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