I am using the new Unified Logging API in Swift.
So I create a logger and use it as below:
let testLogger = OSLog(subsystem: "my.subsystem", category: "test")
os_log("just a test: %@", log: testLogger, type: .error, "error")
How can I retrieve the logged message if the iOS device is disconnected from the Mac?
I know that the new Console application shows messages logged when the device is connected to the Mac. However, I want to retrieve a message that was logged when the device was disconnected from the computer. How can I achieve that?
Thank you.
On iOS 11, you can now capture a sysdiagnose and get access to the sysdiagnose for emailing (don't email this, it's huge), or exporting to dropbox/airdrop to your Mac. Instructions.
The gist of it is :
Settings > Privacy > Analytics > Analytics Data > sysdiagnose_[xxx] > tap share icon in the nav bar
. For me it took less than a minute.
Search the logs for sysdiagnose
. It will be something like sysdiagnose_2018.12.13_14-16-19-0500_iPhone_OS_iPhone_15G77
Then share it through AirDrop. You don't need a cable and iTunes anymore.
The only way I have been able to uncover is to trigger a sysdiagnose on the iOS device, then connect it to a computer and let it sync with iTunes, then gather the logs from the filesystem.
To trigger a sysdiagnose on an iOS device you need to press the volume up, volume down and power buttons at the same time. Then wait for it to finish. Apple says "10 minutes". Then connect to a computer and sync with iTunes.
The logs are on macOS here:
~/Library/Logs/CrashReporter/MobileDevice/[Your_Device_Name]/DiagnosticLogs/sysdiagnose
On Windows, I am not sure.
More details in Apple sysdiagnose intructions
Original answer from here
The current steps in iOS14 are like this:
General > Accessibility > Touch >> Assistive Touch >> Single Tap >> Analytics
Finally, touch the button. Sysdiagnose will start.
Once you’re done. Disable it, because you don’t want to constantly trigger that sysdiagnose…
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