Skip to main content

Dark Mode on iOS

Dark Mode setting is the system-wide appearance that uses a dark interface background to enable better viewing in low-light conditions. The Dark Mode setting makes foreground content appear more vibrant in contrast to darker backgrounds.

You can test different scenarios for your app that supports dark mode by enabling the setting on remote BrowserStack iOS devices.

This guide helps you with:

Supported devices and OS

Devices OS Version
iPhones and iPads iOS 13 and above

Enable dark mode setting

Use the updateIosDeviceSettings capability for W3C protocol and browserstack.updateIosDeviceSettings capability for JSON wire protocol in your test scripts.

Capability Description
updateIosDeviceSettings Set darkMode configuration to "true" inside the updateIosDeviceSettings capability to enable dark mode setting on the device
Capability Description
browserstack.updateIosDeviceSettings Set darkMode configuration to "true" inside the browserstack.updateIosDeviceSettings capability to enable dark mode setting on the device

Example:

DesiredCapabilities capabilities = new DesiredCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
HashMap<String, Boolean> options = new HashMap<>();
options.put("darkMode", true);

browserstackOptions.put("updateIosDeviceSettings", options);

capabilities.setCapability("bstack:options", browserstackOptions);
var capabilities = {
	'bstack:options' : {
		"updateIosDeviceSettings" : {
            "darkMode" : "true" 
        }
	}
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> browserstackOptions = new Dictionary<string, object>();
Dictionary<string, object> updateIosDeviceSettings = new Dictionary<string, object>();
updateIosDeviceSettings.Add("darkMode", "true");
browserstackOptions.Add("updateIosDeviceSettings", updateIosDeviceSettings);
capabilities.AddAdditionalCapability("bstack:options", browserstackOptions);
desired_cap = {
    'bstack:options' : {
        "updateIosDeviceSettings" : {
            "darkMode" : "true"
        }
    }
}
capabilities = {
	'bstack:options' => {
        "updateIosDeviceSettings" => {
            "darkMode" => "true"
        }
	}
}
DesiredCapabilities caps = new DesiredCapabilities();
HashMap<String, Boolean> updateDeviceSettings = new HashMap<>();
updateDeviceSettings.put("darkMode", true);

caps.setCapability("browserstack.updateIosDeviceSettings", updateDeviceSettings);
var capabilities = {
	"browserstack.updateIosDeviceSettings" : {
        "darkMode" : "true" 
    }
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> updateIosDeviceSettings = new Dictionary<string, object>();
updateIosDeviceSettings.Add("darkMode","true");
capabilities.AddAdditionalCapability("browserstack.updateIosDeviceSettings", updateIosDeviceSettings);

desired_cap = {
    "browserstack.updateIosDeviceSettings" : {
        "darkMode" : "true"
    }
}
capabilities = {
        "browserstack.updateIosDeviceSettings" => {
            "darkMode" => "true"
        }
}

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert