Skip to main content
Glama

adb_stop_app

Stop an app on an Android device by specifying its package name using the ADB MCP Server. Manage app processes remotely for efficient Android device automation and control.

Instructions

Stop an app on the device

Input Schema

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

Implementation Reference

  • The core handler function in AppTools class that executes the ADB shell command 'am force-stop' to 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' }; }
  • The tool schema definition including input schema for parameters packageName (required) and deviceId (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)
    The switch case in the CallToolRequest handler that registers and dispatches to the 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