iOS 10 doesn't print NSLogs

后端 未结 9 1482
情书的邮戳
情书的邮戳 2020-12-04 09:43

Nothing prints from NSLog on Xcode 8.0 beta (8S128d). printf is unchanged

Here\'s my code:

NSLog(@\"hello from NSLog\");
pr         


        
9条回答
  •  盖世英雄少女心
    2020-12-04 10:04

    NSLog messages no longer displayed when I upgraded to Xcode 9.1 + iOS 11.1. Initially the accepted answer gave me a way to work around this using the Console app and enabling the Simulator (see Lucas' answer).

    In the Console app under Action I tried selecting Include Debug Messages and deselecting Include Info Messages (so the Console isn't swamped with system messages). NSLog messages appeared in the Console window in Xcode but not in the Console app.

    I realised there had to be a more direct way to disable or enable (i.e. default) NSLogs thanks to Coeur's comment in response to this answer. In my opinion it is the best answer because setting OS_ACTIVITY_MODE to disable or default will make more sense for beginners.

提交回复
热议问题