I'm looking for a way to read the watch's syslog in real-time, similar to the way Device Console or this do it for the iPhone.
It's ok if the phone will be plugged by usb to the computer at the time I'm reading.
At this point I'll even settle for a solution that somehow reads the texts at real-time from Xcode debug console, really (though I will prefer a way to hook in to the watch's syslog in a standard fashion :)..
Thanks!
I know this is an old thread, but for anyone who lands on this search, there is way to do this: https://forums.developer.apple.com/thread/94693.
To summarize, load a diagnostic profile onto the watch, (link in the forum post,) then you can use MacOS system console to see the watch messages. Right now I'm having a strange issue where some of the messages I
NSLog()
appear and others don't, but you can see the watch messages in real time.While I couldn't find any official way to get logs from the device, I did manage to write a hack that does so in real time.
It uses a python GUI automation library to pull the text from the Xcode console window.
Please notice this solution does have it's limitations, as it:
However, it did solve my problem and I'm publishing the short python code in the hopes that it will help other developers.
Notice you may have to play with some of the indexes inside get_console() to get the console window in your Xcode setup.
(If you're interested, this hack code was written for a hackathon project, as a way to get fast data from the watch since it couldn't send any UDP packets on WatchOS2 Beta 4 and the official ways of sending data from the watch [such as
sendMessageData:replyHandler:errorHandler:
] were too slow for what we needed).