Skip to content

log_stream

The log_stream tool captures live, real-time log output from a booted simulator or connected physical device. It uses Apple’s unified logging system (os_log) under the hood, allowing you to apply powerful predicate filters to isolate logs from specific subsystems, categories, or processes. The stream runs for a configurable duration and returns the captured entries.

ParameterTypeRequiredDefaultDescription
deviceIdstringYesUDID of the simulator or physical device to stream logs from.
predicatestringNoNSPredicate-style filter expression (e.g., subsystem == "com.example.app").
levelenumNo"default"Minimum log level to include. One of "default", "info", or "debug".
timeoutnumberNo10Duration in seconds to capture the log stream before automatically stopping.

Stream all logs from a simulator for 10 seconds

Section titled “Stream all logs from a simulator for 10 seconds”

“Show me live logs from my iPhone 16 Pro simulator”

{
"deviceId": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
}

“Stream logs from my WeatherApp on the booted simulator”

{
"deviceId": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890",
"predicate": "subsystem == \"com.myteam.WeatherApp\"",
"level": "debug",
"timeout": 15
}

“Stream only network-related logs from my app for 20 seconds”

{
"deviceId": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890",
"predicate": "subsystem == \"com.myteam.WeatherApp\" AND category == \"networking\"",
"level": "info",
"timeout": 20
}

Capture error-level logs across the entire system

Section titled “Capture error-level logs across the entire system”

“Show me all default-level-and-above logs from the simulator for 5 seconds”

{
"deviceId": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890",
"level": "default",
"timeout": 5
}
2026-02-23 14:32:01.234 WeatherApp[1842:67890] [networking] Starting request: GET https://api.weather.example.com/v1/forecast?lat=37.7749&lon=-122.4194
2026-02-23 14:32:01.567 WeatherApp[1842:67890] [networking] Response received: 200 OK (245 bytes, 333ms)
2026-02-23 14:32:01.589 WeatherApp[1842:67891] [viewmodel] Decoded 7-day forecast for San Francisco
2026-02-23 14:32:01.602 WeatherApp[1842:67891] [ui] Refreshing ForecastListView with 7 items
2026-02-23 14:32:02.105 WeatherApp[1842:67892] [coredata] Saved forecast snapshot to persistent store
2026-02-23 14:32:05.001 WeatherApp[1842:67890] [networking] Starting request: GET https://api.weather.example.com/v1/alerts?lat=37.7749&lon=-122.4194
2026-02-23 14:32:05.210 WeatherApp[1842:67890] [networking] Response received: 200 OK (82 bytes, 209ms)
2026-02-23 14:32:05.230 WeatherApp[1842:67891] [viewmodel] No active weather alerts for region
Stream ended after 15 seconds. 8 log entries captured.
  • log_collect — Collect historical logs from a past time range instead of streaming live.
  • app_launch — Launch an app with console output captured at startup.
  • diagnostics — Collect a full diagnostic report including system logs, crash reports, and more.