34

I am working on an iPhone/iPad app. All of a sudden output console stopped displaying ANY messages AT ALL. I tried to open older project - works just fine. So I thought that local project's repository got corrupted somehow, so I tried to create a new project - no messages at all are getting written to console output. Did I do something with Xcode settings accidentally? I am at a complete loss and frustrated.

Please help if you have any ideas.

Thanks.

ITGronk
  • 621
  • 1
  • 6
  • 13
  • 3
    In the bottom right of the debug area, you should see two half-filled squares. If the right one is gray, click it. – Kevin Nov 07 '13 at 05:40
  • 1
    Sorry, I guess the point is that NO messages are getting written to output period. Code doesn't even matter really. Even if I were to NSLog a hardcoded NSString in a property's getter (lazy instantiation) it still won't show. And yes, Kevin, I do have my output console visible. I was thinking more of a possible Xcode bug and if anybody knew anything about it... – ITGronk Nov 07 '13 at 06:01
  • @ITGronk: See in the console the selected item is "All Output". I think this may be your problem – TamilKing Nov 07 '13 at 07:18

15 Answers15

57

In the debug area, hit the right half-square.

debug area

N.B. area shrunk for image size. Yours should be wider.

Kevin
  • 53,822
  • 15
  • 101
  • 132
37

This question appears all over the place and is a valid one pointing to a random bug in most versions of xcode. Obviously the majority of people arriving at these answers are just unable to use xcode and therefore credit the 'show the console' type answers. I have worked on a single major project for 6 years now and this appears every month or so. I reboot devices, restart xcode, stand in the corner singing yankee doodle dandy. Nothing has occurred to me as an obvious and repeatable fix. Eventually I will start work one morning and it will be working again. Nothing I have done will be an obvious fix, no updates will have been installed. Just a heads up to those thinking they are going mad.

amergin
  • 3,106
  • 32
  • 44
  • 7
    Ohh! I've haven't tried standing in the corner! Thanks! :'D – Aviram Netanel Apr 17 '19 at 14:37
  • 1
    I have just been through this nothing obvious nor repeatable fix scenario. I tried restarting Xcode and macOS. Next I tried deleting all the derived data for the project with no joy. Other Xcode projects when simultaneously open were outputting to the console. Then I decided to try targeting another simulator device and the console log started to work. When I switched back to the previous device the log problem started occurred again. After I selected the Simulator > Device > Erase All Content and Settings... for device with the problems the log output problem was solved ... for now. – Kpalser Jan 15 '23 at 20:40
26

Please make sure, You are selecting All Output

enter image description here

iDeveloper
  • 2,339
  • 2
  • 24
  • 38
6

I've build a new scheme, and on the Launch option I checked: "Wait for executable to be launched" (as in the picture below)

and apparently that disables the NSLog... according to this:

NSLog not working when "wait for executable to be launched" is set

enter image description here

Aviram Netanel
  • 12,633
  • 9
  • 45
  • 69
2

Xcode 10.1 targeting iOS 11, Xcode stopped displaying console output from one build to another minutes later.

I have OS_ACTIVITY_MODE as an environment variable in my scheme and I get no output in the console in Xcode.

If I disable or remove OS_ACTIVITY_MODE from my scheme my log appears in the console - alas with a lot of system logging as well.

Try disabling OS_ACTIVITY_MODE from Edit scheme > Run, in the section Environment Variables if you have it set there.

Niels Castle
  • 8,039
  • 35
  • 56
1

Not exactly sure what was happening, but everything works just fine now (after I started Xcode again today). I did have everything turned on (showing output console with "all" checked).

I appreciate everybody's help.

ITGronk
  • 621
  • 1
  • 6
  • 13
1

This happened to me as well and it turned to be the following:

  • installed release build of my app OTA
  • installed over top of release build in XCode/debugger

Only once I deleted the app from the iPhone's home screen and reinstalled again by running the app in the debugger did console output start working again.

Ray
  • 21
  • 2
1

Let's work this out step by step

NSLog posts to stderr stream and not stdout.

So, first check if you stdout also has the issue by using old school printf function (UTF8string). If this also doesn't work, the problem is most likely not with the logging function. If it does work, the problem maybe with stderr stream or the NSLog function

After this try logging to a file, by redirecting the stderr and then stdout also to a file. (freopen/dup2 function) If this logs properly, the problem may be in your Xcode project or console.

Please note that if you are already using some sort of redirection, then logs will not be printed in the console. They will either be printed in the console or the file ONLY

Try doing more similar experiments to localize your problem. Please comment on this answer with your observations to give us a better understanding of the issue

Shravya Boggarapu
  • 572
  • 1
  • 7
  • 23
1

In my case it was due to hitting resource limits. iTerm was unable to fork new processes.

Quitting some apps or increasing resource limits may help.

Kyle Crawford
  • 71
  • 1
  • 3
1

XCode 9, problem still exists. I did discover that when this starts to happen I don't show the debug area (middle button in pic). Then when I re-run the app, the debug area came back up with the console showing correctly.

enter image description here

Micah Montoya
  • 757
  • 1
  • 8
  • 24
1

Doubtful anyone will have my same issue, but mine was because my iPad was set to Single App Mode using JAMF or MVM Deployment, and it will not log anything to the console. Other devices print to the console, but the app that is in Single App Mode will not.

Dave Levy
  • 1,036
  • 13
  • 20
  • 1
    Supervised device in Single App mode for the app I was debugging. Running on device worked but didn't print anything to the console. Disabling Single App mode fixed it. – Twilite Nov 27 '19 at 14:37
1

Try to press the trash bin icon.

I know it's silly, but in my case it worked. It might've refreshed the log output console:

enter image description here

Anton P
  • 71
  • 1
  • 3
1

I had OS_ACTIVITY_MODE checked to disabled. once i removed this the console was showing debug info again. enter image description here

Vitaly
  • 31
  • 1
  • 4
0

Using filter?

A similar thing happened to me. In my case, I had by misstake entered a filter in the status bar of the debug area. Only rows that match the filter are displayed, and since my filter was rubbish nothing was displayed.

ragnarius
  • 5,642
  • 10
  • 47
  • 68
0

It can also be that somebody has put

#define NSLog(...);

into your code. This eliminates almost all output.

f.b.
  • 490
  • 1
  • 5
  • 17