mobile_terminate_app
Stop and terminate a running app on a mobile device by specifying the app's package name, enabling efficient app management and automation tasks.
Instructions
Stop and terminate an app on mobile device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packageName | Yes | The package name of the app to terminate |
Implementation Reference
- src/server.ts:277-289 (handler)Primary handler and registration for the MCP 'mobile_terminate_app' tool. Defines the input schema (device ID and packageName), retrieves the platform-specific Robot instance via getRobotFromDevice, and calls terminateApp on it.tool( "mobile_terminate_app", "Stop and terminate an app on mobile device", { device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), packageName: z.string().describe("The package name of the app to terminate"), }, async ({ device, packageName }) => { const robot = getRobotFromDevice(device); await robot.terminateApp(packageName); return `Terminated app ${packageName}`; } );
- src/android.ts:357-359 (helper)AndroidRobot implementation of terminateApp: executes ADB shell command to force-stop the app.public async terminateApp(packageName: string): Promise<void> { this.adb("shell", "am", "force-stop", packageName); }
- src/ios.ts:145-148 (helper)IosRobot implementation of terminateApp: ensures tunnel is running and uses go-ios 'kill' command.public async terminateApp(packageName: string): Promise<void> { await this.assertTunnelRunning(); await this.ios("kill", packageName); }
- src/iphone-simulator.ts:119-121 (helper)Simctl (iOS Simulator) implementation of terminateApp: uses xcrun simctl terminate command.public async terminateApp(packageName: string) { this.simctl("terminate", this.simulatorUuid, packageName); }
- src/server.ts:280-283 (schema)Zod input schema for the mobile_terminate_app tool parameters.{ device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."), packageName: z.string().describe("The package name of the app to terminate"), },