iOS Simulator: Read Logs
ios_simulator_read_logsRead an app's log output: stdout, stderr and every Logger/os_log message the process emits, interleaved in one file. Only available for an app started with ios_simulator_launch capture_logs: true.
Instructions
Read an app's log output: stdout, stderr and every Logger/os_log message the process emits, interleaved in one file. Only available for an app started with ios_simulator_launch capture_logs: true. Returns the newest limit lines plus a next cursor; pass it back to get only what arrived since, which is how to see what one tap logged. capturing turns false once the app's process has exited, and what it wrote stays readable. A crash's backtrace is not in here — see ios_simulator_list_crash_logs — but its fatalError message is.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Most lines to return; the newest are kept and the rest counted in `omitted`. Defaults to 200 — filter rather than raising this. | |
| cursor | No | The `next` value from the previous read, to get only newer lines. Omit to read from the start of the capture. | |
| device | No | Which simulator: its UDID or its name as shown by ios_simulator_list. Omit it when exactly one is booted — that is the normal case, and IOS_SIMULATOR_ID pins it when it is not. Unlike simctl's own `booted`, this never picks arbitrarily between two. | |
| filter | No | Case-insensitive regular expression a line must match, e.g. "error|fail" or "\[Sync\]". Applied before `limit`, so it finds matches across the whole range. | |
| bundle_id | No | Which app's capture, e.g. "io.mgcrea.Canopy". Defaults to the most recent capture. |