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?
5 Answers
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.
-
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 '14 at 02:00
-
2And Saniul Ahmed points out on Twitter https://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 '14 at 09:12
-
3Still works for Xcode 7.2 in late 2015. Screw Apple for making such an important, useful feature so incredibly unobvious to find. – DefenestrationDay Dec 23 '15 at 17:13
-
-
ofcourse this only seems to be retaining half an hour of logs for me ... sigh :( – Sam Saffron Aug 25 '16 at 23:35
-
Couldn't find device logs (now in Xcode 8.3), found this answer (thank you!), went to upvote and discovered I already had sometime in the past. Apple really know how to make bad UI decisions at times. – CupawnTae May 05 '17 at 09:42
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.

- 12,937
- 5
- 50
- 82
-
7For 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 08 '13 at 20:17
-
2
-
For me, it showns up under Window > Devices and a list of devices and simulators appear on the left hand side. – Ninja May 19 '15 at 02:34
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.
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.

- 14,192
- 3
- 29
- 60
It gets written to the Console log on the device. You can read it in the "Organizer" within Xcode when your device is connected.

- 22,341
- 9
- 69
- 82
It gets logged out. You can retrieve it by connecting the device and looking in the organizing in xcode

- 2,429
- 1
- 21
- 24