android_devtools_console_logs
Collect console logs, exceptions, and log entries from a page running on the device for a time window. Enables Runtime and Log domains, then listens for Runtime.consoleAPICalled, Runtime.exceptionThrown, and Log.entryAdded events. Returns a normalized array of { level, text, url?, lineNumber? } entries. This is a LIVE-WINDOW collector: it only captures events fired AFTER it attaches, so triggering the logging from a SEPARATE tool call races the ~1-3s attach latency and is silently missed. To capture logs from an action, pass triggerJs (runs inside the window). Default window: 3 000 ms. Maximum: 15 000 ms. Omit pageId to auto-select the visible/active page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Device serial number (UDID) | |
| pageId | No | Target page id (auto-picked when omitted) | |
| socket | No | Abstract unix socket name (default: chrome_devtools_remote) | |
| triggerJs | No | JavaScript run INSIDE the collection window (right after the listeners attach) so the logs it produces are captured race-free — e.g. "location.reload()", "document.querySelector('#go').click()", or "console.log('probe')". Prefer this over triggering from a separate call. | |
| durationMs | No | Collection window in milliseconds (default: 3000, max: 15000) |