NSLog not printing to console

后端 未结 7 879
渐次进展
渐次进展 2020-12-13 17:38

I have an Xcode project I\'ve been working on for months. I\'ve never had a problem with NSLog, but after upgrading to Xcode 4.2 nothing will log to the console. I even trie

相关标签:
7条回答
  • 2020-12-13 17:45

    Well, this is embarrassing. The console got deactivated somehow and I was actually watching the variables window. Pressing Shift + + C did the trick.

    Many thanks to Robert King on this thread:

    https://devforums.apple.com/message/565880#565880

    0 讨论(0)
  • 2020-12-13 17:46

    I had the same issue. The trick is to search and remove the below mentioned line from the project.

      #define NSLog(...)
    

    Search the entire project and remove it.

    0 讨论(0)
  • 2020-12-13 17:51

    This is a bug of Xcode8 + iOS10, we can solve it in this way:

    When on simulator, add the Name OS_ACTIVITY_MODE and the Value Variables disable and check it (Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).

    When on device, only add OS_ACTIVITY_MODE and check it(don't add the Value). You'll see the NSLog in the Xcode8 Console.

    0 讨论(0)
  • 2020-12-13 17:51

    In iOS10, a lot of system logging is displayed on the console. This can be disabled by including the OS_ACTIVITY_MODE = disabled in the Run Arguments for your scheme

    However for iOS10, NSLog messages will not be displayed anymore. In lower iOS versions the messages will still be displayed. So maybe for most test cases you can use a lower iOS version.

    Otherwise you can include a Swift function which prints (print function) your text, this is working okay in iOS10.

    Tested on iOS10.0.2 and iOS9.3

    0 讨论(0)
  • 2020-12-13 17:53

    My issue is that I have Debugger Output selected. Once I changed it to either All output or target output NSLogs appear fine.

    In case this confuses you its on the left of the Debug area.

    0 讨论(0)
  • 2020-12-13 18:03

    I just experienced this, so here's another thing to check.

    -> Make sure you don't have anything typed in the Filter field below the Log Output. So, in my case I was searching for a term in the logger and forgot to delete the searched terms out of the Filter text field. DOH!

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