ios_safari_console_logs
Collect console logs, exceptions, and log entries from a Safari page on an iOS device over a time window. Enables the Runtime and Log domains, then listens for Runtime.consoleAPICalled, Runtime.exceptionThrown, and Log.entryAdded events, and returns an array of { level, text, url?, line?, source? }. This is a LIVE-WINDOW collector: it only captures events fired AFTER it attaches (plus the buffered history WebKit replays on enable), so triggering the logging from a SEPARATE tool call races the attach and is missed. To capture logs from an action, pass triggerJs (run inside the window). Default window: 5 000 ms. Maximum: 15 000 ms. Omit pageId to auto-pick the active page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | iOS device UDID | |
| pageId | No | CDP target id from ios_safari_list_pages. Omit it to use the page ios_safari_navigate last landed on (or, failing that, the first loaded page) — only pass it to target a DIFFERENT tab | |
| triggerJs | No | JavaScript run INSIDE the collection window (after the listeners attach) so the logs it produces are captured race-free — e.g. "location.reload()" or "document.querySelector('#go').click()". Prefer this over triggering from a separate call. | |
| durationMs | No | Collection window in milliseconds (default: 5000, max: 15000) | |
| platformVersion | No | Ignored (kept for compatibility) |