iOS Simulator
console logs
iOS development
debugging
Xcode tips

How to see iOS Simulator console logs in Xcode, Terminal and Console.app

Codemia Knowledge Hub ·

The quickest way to see iOS Simulator console logs is Xcode's debug console, which appears when you run the app with Cmd + R (open it with Cmd + Shift + C). For advanced filtering, stream logs in Terminal with xcrun simctl spawn booted log stream, or open the macOS Console app. Each fits a different workflow, from quick print() checks to structured log analysis.

Method 1: Xcode debug console

This covers most debugging.

Opening the console in Xcode

  1. Open the project in Xcode and pick an iOS Simulator as the run destination.
  2. Run the app with Cmd + R.
  3. Show the console with Cmd + Shift + C or View > Debug Area > Activate Console.

The console sits at the bottom of the Xcode window and updates in real time.

What the console shows

It captures output from:

swift
1// Swift
2print("User tapped login button")          // stdout
3debugPrint(userObject)                      // stdout with debug description
4NSLog("Network request started")            // system log + stdout
5
6// Objective-C
7NSLog(@"Network request started: %@", url); // system log + stdout

NSLog() writes to the system log with a timestamp and process identifier, while print() writes only to stdout. Both show in the Xcode console, but only NSLog() output appears in the macOS Console app.

Filtering console output

The filter bar at the bottom of the console narrows output by keyword, and toggle buttons switch between your app's output and all process output.

For structured filtering, log with the os framework instead of print():

swift
1import os
2
3let logger = Logger(subsystem: "com.myapp", category: "networking")
4
5logger.debug("Starting request to \(url)")
6logger.info("Response received: \(statusCode)")
7logger.error("Request failed: \(error.localizedDescription)")

These entries carry severity levels that Xcode can filter by category and type.

Method 2: Terminal with xcrun simctl

simctl gives you the simulator's log stream from the command line, useful for capturing logs without Xcode or applying complex filters.

List booted simulators

bash
xcrun simctl list devices booted

This shows only running simulators with their UDIDs.

Stream logs in real time

bash
xcrun simctl spawn booted log stream --level debug

This streams everything from the booted simulator. It is verbose, so filter it.

Filter by process name

bash
xcrun simctl spawn booted log stream \
  --predicate 'process == "MyApp"' \
  --level debug

Filter by subsystem and category

If your app uses the os logging framework:

bash
xcrun simctl spawn booted log stream \
  --predicate 'subsystem == "com.myapp" AND category == "networking"' \
  --level debug

Filter by message content

bash
xcrun simctl spawn booted log stream \
  --predicate 'eventMessage CONTAINS "error"' \
  --level debug

Output styles

bash
1# Compact format (one line per entry)
2xcrun simctl spawn booted log stream --style compact
3
4# JSON format (for piping to jq or scripts)
5xcrun simctl spawn booted log stream --style json
6
7# Syslog format
8xcrun simctl spawn booted log stream --style syslog

Method 3: macOS Console app

Console.app (Applications > Utilities > Console) is a graphical browser for logs from all processes, simulators included.

  1. Open Console.app.
  2. In the left sidebar, find the simulator in the devices list. Booted simulators appear by name.
  3. Click it to view its log stream.
  4. Use the search bar to filter by your app's bundle identifier or keywords.

It is especially useful for logs from system frameworks your app interacts with, such as networking, push notifications or background task scheduling, which don't show in the Xcode console.

Method 4: Reading past logs

For crashes or issues that already happened, read historical logs:

bash
1# Show logs from the last 5 minutes
2xcrun simctl spawn booted log show --last 5m \
3  --predicate 'process == "MyApp"'
4
5# Show logs from a specific time range
6xcrun simctl spawn booted log show \
7  --start "2024-03-15 14:00:00" \
8  --end "2024-03-15 14:05:00" \
9  --predicate 'process == "MyApp"'

Collecting a log archive

To share logs or attach them to a bug report:

bash
xcrun simctl spawn booted log collect --output ~/Desktop/sim-logs.logarchive

Open the .logarchive file in Console.app for a full browsable view.

Which method to use

MethodReal-timeHistoricalFilteringBest for
Xcode ConsoleYesNoBasic text filterDay-to-day development
xcrun simctl log streamYesNoPredicate-based (powerful)Advanced filtering, headless CI
xcrun simctl log showNoYesPredicate-based (powerful)Post-crash analysis
macOS Console.appYesYesGUI search barSystem-level log inspection

Logging that is easier to read in the simulator

Use os.Logger instead of print()

The os framework gives structured output with severity levels, subsystem grouping and automatic redaction of sensitive data in release builds:

swift
1import os
2
3private let logger = Logger(subsystem: "com.myapp", category: "auth")
4
5func login(username: String) {
6    logger.info("Login attempt for user: \(username, privacy: .private)")
7    // ...
8    logger.error("Login failed: \(error.localizedDescription)")
9}

privacy: .private redacts the value in non-debug builds, so sensitive data doesn't leak into production logs.

Add signpost intervals for performance

swift
1import os
2
3let signposter = OSSignposter(subsystem: "com.myapp", category: "performance")
4
5func loadData() {
6    let id = signposter.makeSignpostID()
7    let state = signposter.beginInterval("DataLoad", id: id)
8    // ... load data ...
9    signposter.endInterval("DataLoad", state)
10}

Signpost intervals show up in Instruments and help you line up log output with performance traces.

Why logs go missing

  • Relying only on print(). It doesn't write to the system log, so its output is gone when the Xcode session ends and Console.app or log show can't retrieve it. Use os.Logger or NSLog() for anything you may need later.
  • Not filtering simctl log stream. Without a --predicate on your app's process, system output overwhelms you.
  • Expecting the Xcode console to show all system logs. It shows only stdout/stderr from your process and os log output at the default level or above. Framework logs, kernel messages and other processes need Console.app or simctl.
  • Running simctl spawn booted with no simulator booted. You get "No devices are booted." Check with xcrun simctl list devices booted first.
  • Heavy NSLog() in production code. It does synchronous I/O and adds overhead. Keep it to debug builds or move to os.Logger, which is built for high-performance logging.

Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Basis Lab
No course covers this one yet

Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.

Build my course
Data Structures & Algorithms practice on Codemia

Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.

Practice algorithms