Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 9, where are my NSLog()s going? Not showing in Xcode console or Console.app

Tags:

xcode

ios

nslog

I'm trying to do some basic logging while I work on an app. I tossed some NSLog()s into my code, but nothing is being printed to the Xcode console below. Literally nothing, not even some startup info as the app launches, etc.

I've got my Xcode console set to display All Output and I've got the variable inspector and the Console open:

enter image description here

enter image description here

I heard about Logging changes and that a new Console.app was introduced that would let me view the logs on the simulators as well, so I thought maybe the logs would show up over there, but while I do so lots of system messages happening I don't see the NSLog()s that I'm making.

Am I missing something? Is there a new setting I need to flip? Where can I see my NSLog()s?

EDIT:

I was doing this with an iOS 11 simulator and got no console output. When I switched to an iOS 9 simulator then I got all of the console output.

like image 661
Kenny Wyland Avatar asked Oct 29 '17 19:10

Kenny Wyland


People also ask

Where can I find 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.

How do I see console in Xcode?

Go to Xcode → Preferences → Debugging → On Start → "Show Console".

Is there a console in Xcode?

In Xcode 4 short cut to display and hide console is (command-shift-Y) , this will show the console and debugger below ur text edior in the same window.


1 Answers

Figured it out. It's not an intermittent issue or one that can just be fixed with a restart. It's a Run configuration issue.

Click on the Run Scheme selector in the top left of Xcode's toolar.

Click Manage Schemes.

enter image description here

Click on your main App Project.

Click the Edit button in the bottom left.

enter image description here

Uncheck OS_ACTIVITY_MODE.

Click Close.

Viola. All your console logs come back.

enter image description here

like image 199
Kenny Wyland Avatar answered Sep 22 '22 06:09

Kenny Wyland