get_device_logs
Retrieve OS-level native device logs—Android logcat and iOS simulator log show—to diagnose crashes, ANRs, system events, and SDK output, with filters for tag, level, search, and line count.
Instructions
Get OS-level device logs. Android: logcat. iOS: log show (simulators only). Captures native logs (crashes, ANRs, system events, SDK logs) — different from JavaScript console logs.
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": "get_device_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Filter by log tag (Android: -s tag, iOS: subsystem). Example: "ReactNativeJS", "ActivityManager" | |
| clear | No | Clear the log buffer before reading (Android only). Useful to capture only new logs from this point forward. Default: false | |
| level | No | Minimum log level. Default: info | |
| lines | No | Number of log lines to return. Default: 50 | |
| search | No | Filter log lines containing this string (case-insensitive) | |
| platform | No | Target platform. Inferred if omitted. | |
| device_id | No | Device ID. Omit for the connected device. | |
| dump_to_file | No | Android only. Write the entire log buffer to a local file and return its path plus a summary, instead of returning log lines. Use when the windowed read is not enough. Default: false |