Streaming Logs from your Mac
To stream logs from the terminal, use the
log stream command in Terminal. You can influence the level of logs you get back by using
Streaming Logs from the Simulator
Doing the above will not include logs in the iOS Simulator. To stream these logs, you have to run the log utility within the booted simulator.
We can use
simctl to do this:
xcrun simctl spawn booted log ...
Filtering Based on Subsystem
If we want to limit the output just to one subsystem, we can filter using the
xcrun simctl spawn booted log stream --debug --predicate 'subsystem == "com.ficklebits.UnifiedLoggingDemo"'
Note that this takes an
NSPredicate type string, so you can do things like
"subsystem CONTAINS[cd] 'foo'", filter on
category, or any of the other fields available to you.