416

While I am developing the iOS app I need to test it in simulator with dark mode option so I can get more clarity about the app UI. But when I go to the Setting I am not getting option for dark mode as real device showing.

10 Answers 10

842
+50

In Settings, scroll down to Developer and then Dark Appearance

enter image description here


Update

In addition to the above, there are now many other ways to enable dark appearance in the simulator, as shown in the many great answers below.

• Change Environment Overrides from Xcode (@AshCameron)

• Toggle Appearance A from the Simulator menu (@Shredder2794)

• Update from the command line using xcrun simctl ui booted appearance … (@blackjacx, @tadija)

• Programmatically using overrideUserInterfaceStyle = .dark (@thisIsTheFoxe)

• Use SimGenie from Curtis Herbert…  https://simgenie.app

Sign up to request clarification or add additional context in comments.

Comments

125

You can toggle the interface mode (i.e. Light / Dark) as well as adjust dynamic type setting on the fly (when the simulator is running) like this:

Dark mode with Xcode

5 Comments

Great answer. Also good to see all the other size and accessibility things, makes it so much quicker when developing
Nice 👍 I would have never clicked on that unmarked button.
this should be the accepted answer I think, short and handy instead of going through multiple menus.
Protip: if you have Simulator in the foreground, over Xcode, you can Command+click on that button in Xcode (and on any switches in that panel) to change settings while keeping the simulator in front! credit: WWDC state of the union iirc
Note that this will only work if you are actively running the app from Xcode—as soon as you've stopped the session, you cannot use this method. However, in practice I find that I often still want to open some app that I know I have installed on the Simulator …and switch to light/dark. For that, ⇧ ⌘ A still works best!
104

You can use the "Toggle Appearance" (ShiftCommandA) setting from the Simulator menu:

Simulator > Features > Toggle Appearance ⇧⌘A

Toggle Appearance

5 Comments

Thnx, it helped a lot.
By far the easiest option
seems : Toggle Appearance ⇧⌘A from the Simulator menu is COMPLETELY broken in both Xcode 13 (June 2022) AND new Xcode 14
In 2024 this is the best answer :)
Still completely broken in Xcode 15.3, does not toggle appearance
20

Automated Appearance Change 🦉

Xcode 11.4 🌟

Apple released a powerful Xcode update which contains some useful things for this topic. Appearance can now be selected directly in the simulator. Just select Features > Toggle Appearance or ++A. The automatic appearance switching could stil be important, e.g. for automated screenshot tests on the command line. The script becomes easy like this when using Xcode 11.4:

device_ids=("C741F3CD-FDAC-49EA-A4DB-7F797B97291E" "428183B6-3EB8-4D36-9938-9D07C141BF49") # The value to use is now just 'dark' or 'light' appearance=dark for device in "${device_ids[@]}"; do xcrun simctl boot $device xcrun simctl ui $device appearance $appearance done 

No more simulator killing or re-setting needed which is a huge performance win. Also no fiddling around with any plist tools anymore - ever. keep in mind that you have to use device ids that are available in the runtime you use. Find them out using xcrun simctl list.

See also my complete script: https://github.com/Blackjacx/Scripts/blob/master/set-simulator-style.sh

Xcode 11.3

There is a way using the command line to switch a simulator between light and dark mode. If you have an array with your device IDs you can do the following:

device_ids=("C741F3CD-FDAC-49EA-A4DB-7F797B97291E" "428183B6-3EB8-4D36-9938-9D07C141BF49") # Determine the plist value for the desired style: "dark" -> 2 / "light" -> 1 style=2 for device_id in "${device_ids[@]}"; do plist_path="${HOME}/Library/Developer/CoreSimulator/Devices/${device_id}/data/Library/Preferences/com.apple.uikitservices.userInterfaceStyleMode.plist" printf '\n%s' "Set style $style for device $device_id ($plist_path)" killall "Simulator" xcrun simctl shutdown booted xcrun simctl erase $device_id # Crate the plist since it might not be available after erase [[ ! -f "$plist_path" ]] && /usr/libexec/PlistBuddy -c "save" $plist_path # Set the style mode plutil -replace UserInterfaceStyleMode -integer $style $plist_path done 

If you want to specify device names in your script - since device IDs are different on different machines - you can also easily find the id's of them using the following bash code:

device_names=("iPhone SE" "iPhone 8" "iPhone 11 Pro" "iPhone 11 Pro Max") device_ids=() for name in "${device_names[@]}"; do id=$(xcrun simctl list --json | jq ".devices | .[] | .[] | select(.name == \"$name\") | .udid" | cut -d\" -f2) device_ids+=("$id") done printf '%s\n' "${device_ids[@]}" 

2 Comments

As of Xcode 11.4 this is supported directly by Simulator.app and the xcrun simctl ui command.
Yep saw this - I'll update the answer as soon as I tested everything 👍 The automation is still nice - especially for automated tests. The new simctl setting will make the above code much easier.
13

Alternatively, you can also switch the appearance programmatically (docs):

override func viewDidLoad() { super.viewDidLoad() #if DEBUG // change the appearance only while testing overrideUserInterfaceStyle = .dark #endif } 

Comments

12

from terminal:

xcrun simctl ui booted appearance light xcrun simctl ui booted appearance dark 

2 Comments

Code only answers are allowed, but it's encouraged to explain the answer as well. Consider adding some explanation.
I use a slight variation for automated UI tests. xcrun simctl boot "iPhone 16 Pro Max" && xcrun simctl ui booted appearance dark This helps by ensuring the simulator is booted and in dark mode before starting my UI tests via CLI.
7

There are two ways to enable dark mode in Simulator. Note: Make sure that you’re using iOS 13 simulator. X-D

Solution 1: Change build settings

  1. Open Settings app
  2. Select Developer
  3. Enable Dark appearance

Screenshot-1

Solution 2: Programmatically

Simply add this code block in your ViewController file.

override func viewDidLoad() { super.viewDidLoad() #if DEBUG // This changes appearance only for debug mode overrideUserInterfaceStyle = .dark #endif } 

Screenshot-2

Check this apple docs for more details.

1 Comment

Fantastic answer. Helped immensely. Toggle appearance from the simulator menu isn't working for me in some cases but from settings does!
1

How to switch between Light, Dark, and Tinted appearances in the Xcode Simulator (iOS 18+)

If you're looking to test your app icon or UI under different system appearances in the Xcode Simulator, here's how to toggle between modes. This is especially useful when checking how your app icons or assets behave in Light, Dark, or the new Tinted mode (iOS 18 only):

Steps:

  1. Long press on an empty space on the Home Screen or on any App Icon.

  2. Tap the Edit button in the top-left corner (occasionally appears top-right depending on Simulator version).

  3. Tap Customize.

  4. Choose between Light, Dark, Automatic, or Tinted.

📝 Note: Tinted mode is only available starting in iOS 18.

1 Comment

You wrote this as iOS 18+ but the options are different under iOS 26. And what you wrote here only applies to the home screen. It doesn't change how an app looks when it is used. You still need to use the Simulator -> Features -> Toggle Appearance menu to switch between light and dark mode for the apps to change appearance.
-1

I know it's not exactly what the author asked, but if you're using SwiftUI you can check how a View looks in Light or Dark themes directly in the Preview canvas, as shown in the image: SwiftUI View preview options

Comments

-4

you can use keyboard shortcut shift + command + A to toggle appearance of simulator.

1 Comment

Please do not post duplicate answers.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.