terminate_app
Force-quit applications on iOS simulators by specifying the bundle identifier, enabling app management and testing automation.
Instructions
Terminate (force-quit) an app on a simulator
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bundle_id | Yes | App bundle identifier (e.g. com.example.myapp) | |
| udid | No | Simulator UDID (optional, defaults to booted simulator) |
Implementation Reference
- src/index.ts:589-599 (handler)The `terminateApp` method that executes the `xcrun simctl terminate` command.
private async terminateApp(bundleId: string, udid?: string) { const target = await resolveUdid(udid); try { await execAsync(`xcrun simctl terminate ${target} ${bundleId}`); } catch { // Ignore errors — app may not be running } return { content: [{ type: 'text', text: `Terminated ${bundleId} on ${target}` }], }; } - src/index.ts:296-307 (registration)The tool definition and schema registration for `terminate_app`.
{ name: 'terminate_app', description: 'Terminate (force-quit) an app on a simulator', inputSchema: { type: 'object', properties: { bundle_id: { type: 'string', description: 'App bundle identifier (e.g. com.example.myapp)' }, udid: { type: 'string', description: 'Simulator UDID (optional, defaults to booted simulator)' }, }, required: ['bundle_id'], additionalProperties: false, }, - src/index.ts:496-497 (handler)The switch case handler that routes the MCP tool call to the `terminateApp` method.
case 'terminate_app': return this.terminateApp(args.bundle_id as string, args.udid);