mobile_terminate_app
Stop and terminate apps on mobile devices by specifying device identifier and package name. Use this tool to close applications during mobile automation testing or device management.
Instructions
Stop and terminate an app on mobile device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | The device identifier to use. Use mobile_list_available_devices to find which devices are available to you. | |
| packageName | Yes | The package name of the app to terminate |
Implementation Reference
- src/server.ts:237-248 (handler)MCP tool registration, schema, and handler for mobile_terminate_app. Delegates to the selected Robot instance's terminateApp method.tool( "mobile_terminate_app", "Stop and terminate an app on mobile device", { packageName: z.string().describe("The package name of the app to terminate"), }, async ({ packageName }) => { requireRobot(); await robot!.terminateApp(packageName); return `Terminated app ${packageName}`; } );
- src/android.ts:252-254 (helper)AndroidRobot implementation of terminateApp using ADB 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 using go-ios 'kill' command after ensuring tunnel.public async terminateApp(packageName: string): Promise<void> { await this.assertTunnelRunning(); await this.ios("kill", packageName); }
- src/iphone-simulator.ts:76-78 (helper)Simctl (iOS Simulator) implementation of terminateApp using xcrun simctl terminate.public async terminateApp(packageName: string) { this.simctl("terminate", this.simulatorUuid, packageName); }