Close an app or end the session
closeTerminate a named app or active session app, optionally shutting down its supported device, to end app sessions and clean up test runs.
Instructions
Close the named app, or close the active session app when app is omitted. The shutdown option also stops the session simulator or emulator where supported; close alone never stops the device. Android ADB close fails with android-app-close-timeout if the app stays foreground past 2s, a killed process does not exit within 10s, or a new process runs past 2s; a relaunching open accepts that new process. It fails with android-process-probe-unavailable when adb pidof cannot list the app processes; if that happens before the force-stop, the app keeps running. If close cannot confirm its cleanup on a session that holds a device claim, the session and its claim stay. A repeated close retries cleanup with the same options, except that save-script must be omitted after publication. Times out after 90s.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "close"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Optional app to close. | |
| udid | No | Apple device or simulator UDID. | |
| force | No | Overwrite an existing --save-script target instead of refusing (alias: --overwrite). | |
| device | No | Device name; ids go in udid or serial. | |
| serial | No | Android, HarmonyOS, or Vega VVD serial. | |
| session | No | Session name. | |
| noRecord | No | Do not record this action. | |
| platform | No | Device platform. | |
| shutdown | No | Shutdown the session/device where supported. | |
| saveScript | No | ||
| deviceTarget | No | Device form factor. |