Hide strange unwanted Xcode logs

前端 未结 13 2728
孤独总比滥情好
孤独总比滥情好 2020-11-22 02:34

When using the Xcode 8+ and creating a new blank project, the following logs appear when running the application:

2016-06-13 16:33:34.406093 TestiOS10[8209:1         


        
13条回答
  •  清酒与你
    2020-11-22 03:16

    Building on the original tweet from @rustyshelf, and illustrated answer from iDevzilla, here's a solution that silences the noise from the simulator without disabling NSLog output from the device.

    1. Under Product > Scheme > Edit Scheme... > Run (Debug), set the OS_ACTIVITY_MODE environment variable to ${DEBUG_ACTIVITY_MODE} so it looks like this:

    1. Go to your project build settings, and click + to add a User-Defined Setting named DEBUG_ACTIVITY_MODE. Expand this setting and Click the + next to Debug to add a platform-specific value. Select the dropdown and change it to "Any iOS Simulator". Then set its value to "disable" so it looks like this:

提交回复
热议问题