appium_session_health
Diagnose mobile test session health by checking device, server, app, and session state; identify failure type and optionally replace a dead session once without resetting app data.
Instructions
Diagnose a session: device state (adb), Appium server (remote), session liveness, app state and foreground, ANR dialog. Returns the failure kind with signals and whether replacing the session would help. With recover=true and only for a recoverable failure (dead session or driver), replaces the session once, bounded to 2 attempts per 10 minutes, never touches other sessions, never resets app data, relaunches the app and verifies the new session. Cloud and attached sessions are not replaced.
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": "appium_session_health"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | No | App to check and restore (defaults to the session capability appPackage/bundleId). | |
| detail | No | Return the full report even when healthy. | |
| recover | No | If the session is dead, delete it and create a new one with the same platform and capabilities. Default false (report only). | |
| sessionId | No | Session ID; defaults to the active session. |