How to get persisted Log files from real iPhone device

Hi,

In our iOS app, we have used OSLog for logging various events(including errors), the app is distributed using test flight on iPhone device. From what we know, OSLog with log levels Notice, Error and Fault persist the logs into disk. Since we have a lot of logs of above mentioned log levels they must are being saved somewhere but I am not able to get the location where they are exactly stored. Part of my question is also that since I don't have access to Mac right now and if I am using just the iPhone with the app, can I get the logs being stored by the app from within the iPhone? May be using itunes or something? Or it it even possible to get it without mac? Also, when we test the app on simulator using xcode, I expect the same behaviour that since we are logging various things, where are the log files getting saved in the mac or simulator? What's the exact path, although I can see all the logs on the console itself but I want to get the files which ios creates. If anyone can guide me through it, it would be very helpful for us, especially regarding getting the logs from real iPhone device(without connecting it to mac)

Thanks, Pranay

The easiest way to do this is to trigger a sysdiagnose log. You can then share the log from System Preferences > Privacy > Analytics & Improvements > Analytics Data, for example, to your Mac using AirDrop. See our Bug Reporting > Profiles and Logs for more about this.

On iOS 15 beta you can write code to access your own log entries using the OSLog framework.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

it was an empty file(0 byte sized) with no content.

Which file? The sysdiagnose log itself (with a name like sysdiagnose_X.tar.gz)? Or the .logarchive that you get after unpacking the sysdiagnose log?

If it’s the sysdiagnose log itself then the most likely cause is that you didn’t wait long enough for the log to finish generating.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to get persisted Log files from real iPhone device
 
 
Q