Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7: show same console log for release build as development build?

This answer addresses how to show the console log in Xcode, but output printed with the print function in Swift that appear in the development build of the app do not appear in the release build.

To be clear, the app was downloaded from the App Store and then Xcode was opened with the console log showing as described by the SO answer.

This answer suggests the print function continues to send output to the console even for release builds.

However, lines that printed to the console for the development build no longer appear for the App Store version.

How do you view the same console output that appears for the development build?

like image 484
Crashalot Avatar asked May 08 '16 02:05

Crashalot


2 Answers

The print function continues to send output even for release build, but it won't appear at the console. To see the output, go to Window -> Devices (or press cmd+shift+2). Connect your device to the Mac and you'll see all the output.

(By the way - it's good practice to remove the logs for the release versions, so you might want to consider it)

like image 67
Roee84 Avatar answered Oct 02 '22 15:10

Roee84


If you want to see the same logs from the release build, you need to use NSLog as before.

like image 41
Hank Liang Avatar answered Oct 02 '22 17:10

Hank Liang