Logging data on device and retrieving the log

P i picture P i · Feb 1, 2012 · Viewed 91.5k times · Source

On a debug build in Xcode, regardless of whether I am using the simulator or an actual device, NSLog, printf, fprintf assert and NSAssert statements come out on the console

If I now run a release build on the device (say I send a test flight build and big it up on my iPhone; this will be a release build), which of these (if any) are getting recorded?

And how do I retrieve the log?

Does NSLog actually output something on release build? What is the determining factor? Whether it is writing to stdout or stderr? is only stderr written to device log? Does this mean I have to use fprintf? Is ANYTHING written to device log? is there even such a thing? If so, how to pick it up?

Could someone clarify the situation?

Answer

Myxtic picture Myxtic · Jan 7, 2015

In Xcode 6.1.1, you can view the NSLog output by doing the following. However, I'm not sure if it lets you see logs from too far back in time. I've only seen it go back up to a couple hours.

In any case, here are the steps:

  1. In Xcode, go to Window -> Devices.
  2. Select your device in the left panel.
  3. Click the little arrow as shown in the screenshot below.

enter image description here