I want to run unit tests on my CI in the simulator when it is set to dark mode. Is there an option for 'xcodebuild' or 'simctl' to put the simulator in dark mode?
Or do I have to file a radar?
I want to run unit tests on my CI in the simulator when it is set to dark mode. Is there an option for 'xcodebuild' or 'simctl' to put the simulator in dark mode?
Or do I have to file a radar?
I have the same request
As an alternative, could you pass a command line argument or set an environment variable which your app delegate could detect and then set overrideUserInterfaceStyle on its window to force dark mode?
Yes, it is available in Settings > Developer. Look for Dark Apperance at the top of the screen.
More details:
You can use xcrun for this:
xcrun simctl ui booted appearance dark
xcrun simctl ui booted appearance light
You can also use the keyboard shortcut Command-Shift-A