In Xcode 8 (and 7 maybe, I can't remember), the simulators would write their logs to ~/Library/Logs/CoreSimulator//system.log. Apps that were running on the simulators would write their "print" or NSLog output to this system.log file as well.
Now, in Xcode 9, the simulator logs still exist in those directories, but the application logs don't seem to be in the system.log file anymore. I can see it in the Xcode or AppCode output, but not in the file.
The reason I'm looking to get at the file through the filesystem (as opposed to using the console app), is that I want to grep and do other stuff with the files that you just can't do with the console app.
Does anyone know if/how to get application output for an app being run on a simulator to the system.log file in Xcode 9?
(Note, I don't think this has anything to do with OS_ACTIVITY_MODE as I'm interested in the app logs, and I can see the app logs in Xcode or AppCode console window).
I finally ran across a blog that outlines what to do! For iOS12 (and likely 11, and maybe even 10).
log stream --level debug --predicate 'senderImagePath contains "<YourAppName>"' --style syslog
will get you the log. Then you can grep or whatever using unix pipes.
The original blog is here: https://fluentreports.com/blog/?p=545. Thanks @NathanA (not sure if he's a SO user though...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With