Xcode doesn't write anything to output console

前端 未结 15 1259
执笔经年
执笔经年 2020-12-06 09:00

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

相关标签:
15条回答
  • 2020-12-06 09:50

    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:

    0 讨论(0)
  • 2020-12-06 09:51

    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.

    0 讨论(0)
  • 2020-12-06 09:55

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

    debug area

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

    0 讨论(0)
  • 2020-12-06 09:55

    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

    0 讨论(0)
  • 2020-12-06 09:56

    It can also be that somebody has put

    #define NSLog(...);
    

    into your code. This elimitaes almost all output.

    0 讨论(0)
  • 2020-12-06 09:57

    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

    0 讨论(0)
提交回复
热议问题