Terminate App on Simulator
simctl-terminateGracefully stop a running iOS app on a simulator, triggering lifecycle callbacks for clean shutdown. Use to reset app state or verify termination handling.
Instructions
simctl-terminate
Gracefully terminate a running iOS app on a simulator.
What it does
Stops a running app by sending a termination signal. The app's lifecycle methods (applicationWillTerminate:) will be called, allowing clean shutdown.
Parameters
udid (string, required): Simulator UDID (from simctl-list)
bundleId (string, required): App bundle ID (e.g., com.example.MyApp)
Returns
JSON response with:
Termination status
Command executed
Guidance for next steps (relaunching, uninstalling, checking container)
Examples
Terminate running app
await simctlTerminateTool({
udid: 'device-123',
bundleId: 'com.example.MyApp'
})Common Use Cases
Clean app restart: Terminate then relaunch to reset app state
Test lifecycle: Verify app handles termination correctly
Memory cleanup: Stop app before running memory-intensive tests
State reset: Terminate app to clear runtime state between test runs
Background testing: Stop foreground app to test background behavior
Important Notes
Graceful termination: App lifecycle methods are called for clean shutdown
Not running OK: Returns error if app is not running, but can be safely ignored
Simulator state: Works on both booted and shutdown simulators
No force kill: This is a graceful termination, not a force kill
Error Handling
App not running: Error returned but operation is safe to ignore
App not installed: Indicates app must be installed first
Simulator not booted: Warning shown but termination may still succeed
Invalid bundle ID: Validates bundle ID format (must contain '.')
Next Steps After Termination
Launch app again:
simctl-launch <udid> <bundleId>Uninstall app:
simctl-uninstall <udid> <bundleId>Check app container:
simctl-get-app-container <udid> <bundleId>Install new build:
simctl-install <udid> /path/to/App.app
Difference from Force Kill
Terminate (this tool): Graceful shutdown with lifecycle callbacks
Force kill: Immediate termination without cleanup (use system kill command)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | ||
| bundleId | Yes |