Skip to main content
Glama

adb_stop_app

Stop a running Android application on a device by specifying its package name. This tool helps manage app processes and free device resources through the ADB MCP Server.

Instructions

Stop an app on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNameYesPackage name of the app to stop
deviceIdNoDevice ID (optional)

Implementation Reference

  • The main handler function that executes the ADB command to force-stop the specified app package.
    async stopApp(packageName: string, deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot stop app - device is not connected' }; } const command = `shell am force-stop ${packageName}`; const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success) { return { success: false, error: result.error, message: 'Failed to stop app' }; } return { success: true, data: { packageName, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `App ${packageName} stopped successfully` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to stop app' }; } }
  • Input schema definition for the adb_stop_app tool, specifying packageName as required and deviceId as optional.
    { name: 'adb_stop_app', description: 'Stop an app on the device', inputSchema: { type: 'object', properties: { packageName: { type: 'string', description: 'Package name of the app to stop', }, deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: ['packageName'], }, },
  • src/index.ts:459-460 (registration)
    Registration of the tool handler in the switch statement, dispatching calls to AppTools.stopApp method.
    case 'adb_stop_app': return await this.handleToolCall(this.appTools.stopApp(args?.packageName as string, args?.deviceId as string));

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/richard0913/adb-mcp'

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