Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see NSLog() from console app when using instruments

I'm using instruments for allocations, but want to see my NSLog messages. In another post they mentioned to look inside /Applications/Utilities/Console for the messages. I can't seem to spot any of them. After you open the Console App, where would you look?

like image 555
prostock Avatar asked Apr 06 '11 15:04

prostock


People also ask

How do I check my NSLog?

NSLog() output on the simulator does indeed show up in the Console Mac OS X application. Go to All Messages and then filter based on your app name to get rid of the fluff, and run again. You'll see it in your output if the NSLog code is actually being hit during the execution of your program.

Where does NSLog write to?

NSLog outputs messages to the Apple System Log facility or to the Console app (usually prefixed with the time and the process id).


2 Answers

You can view the console of the device using Xcode Organizer. Screenshot of Organizer

In Xcode 6, the "Devices" tab was removed from the Organizer into it's own window. To view the console log, you now have to click the tiny little triangle in the lower left-hand area of the device information.

Xcode 6 iOS Device Console Log Example

like image 119
Black Frog Avatar answered Sep 29 '22 20:09

Black Frog


Alternative to Black Frogs answer, you can also use the integrated console from your mac directly without Xcode. All output is forwarded there. Just do a spotlight search (CMD + Space) and type in console.

like image 33
denbec Avatar answered Sep 29 '22 18:09

denbec