Debug issue that only occurs while device is unplugged

I have an issue that occurs in my released application that only happens when the device is unplugged. I think the logs I emit during normal operation would give me a hint as to what happens, but I cannot find a way to either stream the logs over wifi or get past logs when I connect the device to my computer. The app is not crashing, so there's no stack trace to speak of, it's just not behaving as expected and I need to see what it thinks is going on. Is there a way to get, for instance, the last 5m of logging that would show up in the Xcode Device Organizer Console when I connect the phone? I can reproduce the issue 100% of the time off USB and 0% of the time on USB, lol. Thanks!

Accepted Reply

the

system_logs.logarchive
files appear to be encrypted

It’s not encrypted, it’s just in a binary format.

I guess I'll have to watch that video to see if it details how to extract it.

Well, you should definitely watch the video, but viewing the log file should be as simple as opening it in the Console utility (10.12 or later). It’s pretty cool.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

The trick here is to take a sysdiagnose of the device when the problem occurs. Then upload the sysdiagnose to your Mac, at which point you can unpack it and get at the

system_logs.logarchive
contained therein, which you can pull apart with the Console utility or the
log
command line tool.

See the Bug Reporting > Profiles and Logs page for instructions on getting the sysdiagnose log. Watch WWDC 2016 Session 721 Unified Logging and Activity Tracing for more information about the new logging system in general.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I did that, all the system_logs.logarchive files appear to be encrypted. I guess I'll have to watch that video to see if it details how to extract it.

the

system_logs.logarchive
files appear to be encrypted

It’s not encrypted, it’s just in a binary format.

I guess I'll have to watch that video to see if it details how to extract it.

Well, you should definitely watch the video, but viewing the log file should be as simple as opening it in the Console utility (10.12 or later). It’s pretty cool.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

While there is definitely value in watching the whole 50m video, the answer of "find the .logarchive and double-click it to open in Console" would have been much more helpful in the midst of my debug problems. Apart from that, why in the world doesn't Console properly open the logarchive if I find it through the Console sidebar!?!? Instead, I have to find the location in Terminal, open that folder in Finder and then double-click the stupid logarchive. I get that you guys are excited about the new logging, but not being able to grep for things we want to find is annoying. Additionally, I'll complain again about the need for a TWENTY MINUTE round trip on logging/changes when I want to see how something performs off power (not plugged into USB for live log streaming).

I’m glad to hear you’re making progress.

With regards your feedback, the best way to make sure that’s seen by the folks responsible for enacting change is to put it in a series of enhancement requests.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"