Configuring Xcode 8+ to Hide Unwanted System Logs

Nov 24, 2025 · Programming · 9 views · 7.8

Keywords: Xcode | iOS Development | Log Configuration

Abstract: This article provides a comprehensive guide on configuring Xcode 8 and later versions to hide various system logs generated during iOS application runtime. These logs originate from subsystems like UIKit, BaseBoard, and FrontBoard, and while useful for system debugging, they often interfere with developers' ability to view their own log outputs during daily development. The article presents two solutions: one that simply disables all activity logs, and another more refined approach that only disables logs in the simulator while preserving them on physical devices. Through step-by-step instructions and code examples, developers can quickly resolve log interference issues and improve development efficiency.

Problem Background

When creating new blank projects in Xcode 8 and later versions, running the application generates numerous system logs in the console. These logs originate from various iOS subsystems, such as:

2016-06-13 16:33:34.406093 TestiOS10[8209:100611] bundleid: com.appc.TestiOS10, enable_level: 0, persist_level: 0, propagate_with_activity: 0
2016-06-13 16:33:34.406323 TestiOS10[8209:100607] Created DB, header sequence number = 248
2016-06-13 16:33:34.409564 TestiOS10[8209:100611] subsystem: com.apple.UIKit, category: HIDEvents, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0

While these logs are valuable for system debugging, they significantly interfere with developers' ability to view their own NSLog or print outputs during daily development work.

Solution 1: Complete Activity Log Disable

The simplest solution involves setting an environment variable to disable these system logs:

  1. From the Xcode menu, open: Product > Scheme > Edit Scheme
  2. In Environment Variables, set OS_ACTIVITY_MODE = disable

This configuration completely disables system activity log output, allowing the console to display only the developer's own log information.

Solution 2: Simulator-Specific Configuration

For more granular control, you can configure the system to disable logs only in the simulator while preserving them on physical devices:

  1. In Product > Scheme > Edit Scheme... > Run (Debug), set the OS_ACTIVITY_MODE environment variable to ${DEBUG_ACTIVITY_MODE}
  2. Navigate to project build settings and add a user-defined setting named DEBUG_ACTIVITY_MODE
  3. Expand this setting and click + next to Debug to add a platform-specific value
  4. Select the dropdown and change it to "Any iOS Simulator", then set its value to "disable"

With this configuration, system logs won't appear when running in the simulator, while full log information remains available during device execution.

Technical Principle Analysis

These system logs originate from iOS's Unified Logging System, which provides structured logging capabilities. The OS_ACTIVITY_MODE environment variable controls the behavior of this logging system:

Best Practice Recommendations

In practical development, we recommend:

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.