How to Enable Dark Mode in iOS Simulator

How to Enable Dark Mode in iOS Simulator

Written by

in

Quick answer: Open Simulator Settings → Developer → Dark Appearance, or use Xcode’s Environment Overrides panel, press ⇧⌘A in Simulator, run xcrun simctl ui booted appearance dark in Terminal, or set overrideUserInterfaceStyle = .dark in your view controller.

Why this happens

iOS Simulator does not surface the system-wide Dark Mode toggle in the same Settings location as a physical device. On a real iPhone, Dark Mode lives under Settings → Display & Brightness. In the Simulator, that section only shows wallpaper and text size options. Apple places the Simulator’s appearance switch under Settings → Developer → Dark Appearance instead, and also exposes several faster, developer-focused toggles that do not exist on hardware.

Because the Simulator is a development tool, Apple prioritizes quick switching for UI testing. The result is multiple overlapping ways to change appearance — each useful in a different workflow.

How to fix it

1. Use the Simulator Settings app (closest to device behavior)

  1. Launch the Simulator.
  2. Open the Settings app on the Simulator home screen.
  3. Scroll down to the Developer section (near the bottom).
  4. Toggle Dark Appearance on.

This persists across Simulator restarts and matches the user-facing path most closely.

2. Toggle via Xcode Environment Overrides (best while debugging)

  1. Run your app from Xcode.
  2. In the debug bar, click the Environment Overrides button (icon: two overlapping sliders).
  3. In the popover, enable Appearance and choose Dark.

The change applies instantly to the running process only. When you stop the debug session, the Simulator returns to its system setting.

3. Keyboard shortcut ⇧⌘A (fastest for manual QA)

With the Simulator window focused, press Shift-Command-A. The interface flips between light and dark immediately. No menus, no mouse travel. This shortcut toggles the Simulator’s global appearance, not just the debugged app.

4. Command line with simctl (automation & CI)

# Dark mode
xcrun simctl ui booted appearance dark

# Light mode
xcrun simctl ui booted appearance light

booted targets the currently running Simulator. Use a specific device UDID instead of booted for scripted device farms. This is the standard way to set appearance in CI pipelines before snapshot tests.

5. Force dark mode in code (per-view or per-window)

// UIViewController / UIView
overrideUserInterfaceStyle = .dark
// SwiftUI (iOS 14+)
MyView()
    .preferredColorScheme(.dark)

Use this for isolated previews, screenshot tests, or when a single screen must ignore the system setting. It does not affect the rest of the Simulator.

How to prevent it

  • Default to Environment Overrides during daily debugging — it’s scoped to the debug session and won’t leak into other apps.
  • Add a launch argument (-UITest_DarkMode) in your UI test scheme and read it in setUp() to call XCUIDevice.shared.press(.home) then simctl for reliable screenshot runs.
  • Document the shortcut (⇧⌘A) in your team’s onboarding checklist; it saves hours of menu hunting.
  • Avoid hard-coding overrideUserInterfaceStyle in production code paths; use trait collections and preferredColorScheme so the app respects the user’s choice.

FAQ

Does the Simulator remember Dark Mode after a cold boot?

Yes. The Settings → Developer → Dark Appearance toggle and the simctl command both write a persistent preference. The Environment Overrides panel and the ⇧⌘A shortcut only affect the current session.

Can I test dynamic color changes without rebuilding?

Absolutely. Toggle Environment Overrides or press ⇧⌘A while the app is running. Any UIColor / Color that uses semantic or dynamic colors will update live.

Why doesn’t my SwiftUI preview reflect the Simulator’s Dark Mode?

Previews run in a separate process. Use .preferredColorScheme(.dark) on the preview wrapper or the Environment Overrides button in the preview canvas to force a scheme independently of the Simulator.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.