See log in XCode for "Wait for executable to be launched"

I'm trying to debug notifications on an iPhone app + WatchApp. So I'm starting it with the "Wait for executable to be launched" option. But then i can't see the logs in XCode.


How can i redirect the logs from the app to the XCode console? Actually i want to see both the logs from the iPhone App and the WatchExtension in XCode. Is this possible?


I'm using XCode 6.4 and lldb. Thanks

Your best option is to view the device’s system log (via Xcode’s Devices window) which will show the log entries from both you app and your extension regardless of whether Xcode is attached or not.

Share and Enjoy

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

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

You have to use Logger for that. It will output the messages to Console.app, as well as to Xcode console.

However, you have to specify them as public, otherwise the message text will be hidden. Like this:

import os.log

let logger = Logger(subsystem: "com.kelin.vladimir", category: "Debug")

// Log level: notice. Explicitly specified `public`.
logger.notice("\("TEST", privacy: .public)")

In order to protect your private data in prod, consider using #if DEBUG macro.

See log in XCode for "Wait for executable to be launched"
 
 
Q