36

My NSLog messages no longer show up in my Debug Area. Anyone have an idea how the could have happened?

I can hit command-7 to bring of a list of logs in the left pane, select the latest one and view it in my editor window, but it is extremely annoying compared to having the console output in the debug area.

13 Answers13

49

I had the same issue. Below are fix for this :

  1. You console may be hidden. Press Show the console button present in right corner (blue coloured when console is open).

    Screenshot 1

  2. You may be displaying Debugger or Target output. Select All Output (Checkmark is displayed when selected).

Screenshot 2

  1. a. Open Xcode preference (shortcut: cmd + ,).

    b. Select Behaviours tab from pop-up.

    c. From the Build sections select Succeeds.

    d. Enable Show debugger with Current Views.

    e. Select Console View from the drop-down list.

Screenshot 3

Screenshot 4

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
  • 1
    You saved my life. I foolish i was. – Saurabh Padwekar Jan 02 '18 at 07:18
  • 1
    Such a lifesaver! I've attempted to fix this before, but never found your answer until now. The All Output thing was the solution. I guess debugger is about things that the **debugger output** prints for you through `po` `p`, etc. **Target output** is simply things that you print through the actual code itself. To test this, simply change the output and you'll see – mfaani May 07 '18 at 20:58
35

Not sure but may be you have clicked on one of the three buttons at the top right corner of the debug area that are used to either show only variables view, only the console or both.

Ashish Awaghad
  • 2,822
  • 3
  • 24
  • 33
33

if you want to display Debug area always, then follow these steps:

  • Goto XCode > Preferences > Behaviors > Succeeds >
  • Check checkbox of Show tab named
  • Type DEBUG in the textbox next to Show tab named
  • select separate window in dropdown next to Textbox
  • Now click checkbox before debugger with and select Console View in the dropdown

enter image description here

Now when you will run our app, console window will popout itself.

And shortcut key for this is command+shift+y

Vaibhav Saran
  • 12,848
  • 3
  • 65
  • 75
11

For me, the answer is to 'activate console'

Go to view -> Debug Area -> Activate Console

oky_sabeni
  • 7,672
  • 15
  • 65
  • 89
9

For Xcode 8

I set OS_ACTIVITY_MODE to disable to hide crazy logging message in simulator. But it will also hide NSLog output on my iPhone SE device (print function in swift still works). Remove the environment variable makes NSLog work again.

Gurinder Batth
  • 655
  • 9
  • 18
9

You have a few choices:

  • In the menus, select View -> Show Debug Area.
  • In the View selection controller in the upper right, enable the bottom view (the one in the middle).
  • If you'd like this to show automatically, go to Preferences -> Behaviors. Select "Run Starts" and enable "Show" Debug Area.
Jon Reid
  • 20,545
  • 2
  • 64
  • 95
5

I had an iOS universal app that would show debugger output for the iPhone version, but not for the iPad version.

I looked into editing the schemes ( commandSHIFT, ) and the iPad scheme had a different debugger than the iPhone scheme. I changed the iPad scheme's debugger to match the iPhone's (from LLDB ---> GDB)

enter image description here

Jesse Black
  • 7,966
  • 3
  • 34
  • 45
5

Make Sure that in your Debugger Area >> Debugger Bar you have Selected ALL OUTPUT

enter image description here

Shekhar Gupta
  • 6,206
  • 3
  • 30
  • 50
4

Took me a while to figure this out... Here's a screenshot of Xcode 6.1.1. Make sure you have chosen All output at 1 and activated the output pane in 2. Somehow the output pane suddenly was gone for me and I just didn't see the icons at the bottom for like 2 hours.

enter image description here

udondan
  • 57,263
  • 20
  • 190
  • 175
3

For me, "Debug Executable" in Scheme Settings (Product-->Scheme-->Edit Scheme: Run) had been unchecked.

enter image description here

Unheilig
  • 16,196
  • 193
  • 68
  • 98
3

On an 12.1 Xcode version you can do either:

Option 1: View > Debug Area > Activate Console

Option 2: Shift + cmd + c (to activate console)

Option 3: (if your console is already activated) Shift + cmd + y

Here is a picture for you:

picture that shows menus and options

Iván Yoed
  • 3,878
  • 31
  • 44
3

Just confirm that you have Xcode open with similar rights as you have the ownership of the files you are trying to build/run and also make sure you have same rights to the build directory. I noticed Xcode won't show any debug output if rights were mismatched. I figured this after facing so much harassment. When this happened, utilities>console was still showing logs. I used that as a workaround.

Mine is: Xcode 4.2 Build 4D199 on OS X 10.7.2

2

If you don't have anything displaying in the logs, the log view will unselect itself and not display itself. You could add a printf and verify this.

Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
KevinW
  • 21
  • 1