iOS 10 doesn't print NSLogs iOS 10 doesn't print NSLogs ios ios

iOS 10 doesn't print NSLogs


It could be that you added the property "OS_ACTIVITY_MODE": "disable" in the Scheme environment variables (to hide OS output from the simulator) and forgot about it, and now are running on a real device.

In Xcode 8:

Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment Variables

Only add OS_ACTIVITY_MODE and check it(Don't add a value)

enter image description here

enter image description here

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

  • When using the simulator, add the Name "OS_ACTIVITY_MODE" and the Value "disable" and check it.

  • When on a real device, only add "OS_ACTIVITY_MODE" and check it(Don't add the Value). You will see the NSLog in the Xcode8 Console.


If you check the Xcode 8 beta release notes, you'll find that it says:

When debugging an app running on Simulator, logs may not be visible in the console. Workaround: Use command + / in Simulator.app to open the system log in the Console app to view NSLogs. (26457535)


the NSlog or print actually is executed but is hidden among lots of other console debug outputs to solve this issueOpen Xcode8:

Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment Variables

add "OS_ACTIVITY_MODE" and set the Value to "disable" and check it.

click close

xcode9

add "OS_ACTIVITY_MODE" and set the Value to "default" and check it.

enter image description hereenter image description here