44

what happens to NSLog info when running on a device? Where does the text go? Does it get saved? Is it therefore a big overhead when running on a device, or does it effectively get sent to null?

1

5 Answers 5

53

Since Xcode 6 the device manager pane has been split into its own window. (Window > Devices, or Command-Shift-2.)

Once there, select your device, then show its log by clicking the disclosure triangle at the bottom of the window to the right of the sidebar.

enter image description here

6
  • Speaking of days, it's worth pointing out (or figuring out if anyone knows) that the log only persists for a little while. Maybe it gets purged more frequently if storage space is running low? (Just checked my phone and it only has 1 minute/500 lines of logs, even with 1.1GB available. It kept running for 5 minutes, never losing anything, and then I replugged it and it was back to ~2 mins/900 lines.)
    – owenfi
    Aug 22, 2014 at 2:00
  • 2
    And Saniul Ahmed points out on Twitter twitter.com/saniul/status/504745567218442240 that the view is actually resizable, but the hand is invisible, to the right and above the disclosure arrow.
    – owenfi
    Aug 29, 2014 at 9:12
  • 3
    Still works for Xcode 7.2 in late 2015. Screw Apple for making such an important, useful feature so incredibly unobvious to find. Dec 23, 2015 at 17:13
  • How to see the memory leak issue in ios app??
    – Mayank
    May 27, 2016 at 13:31
  • ofcourse this only seems to be retaining half an hour of logs for me ... sigh :( Aug 25, 2016 at 23:35
31

Your device will continue logging even when it's not connected to your mac. To see the logs, you need to open Xcode, click the 'Window' menu item, and then 'Organizer'. Then select your device and then select the 'Device Logs' tab. For some reason (for me at least) viewing the logs seems flaky, so if nothing shows up, you may need to completely quit Xcode and restart it.

3
  • 7
    For me (XCode 4.6), "Device Logs" only shows crash logs & jettisons. Console seems to show only system output (not my app.) Any other hints? Thanks!
    – Olie
    Feb 8, 2013 at 20:17
  • 2
    Oop -- duh. It's under console -- same organizer window.
    – Olie
    Feb 8, 2013 at 20:30
  • For me, it showns up under Window > Devices and a list of devices and simulators appear on the left hand side.
    – Ninja
    May 19, 2015 at 2:34
6

The text is logged. You can view the logs in xcode via the (almost-invisible) disclosure triangle in the Devices window as described in another answer.

You can also access the logs in a more usable view (including filtering) by opening Console.app on your connected Mac and selecting the device on the left.

Console.app screenshot

There will be some overhead with logging, but considering the volume of logging that's going on all the time in recent versions of iOS, unless you're generating an awful lot of output (or spending time generating the messages), it's unlikely to be significant.

5

It gets written to the Console log on the device. You can read it in the "Organizer" within Xcode when your device is connected.

2

It gets logged out. You can retrieve it by connecting the device and looking in the organizing in xcode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.