29

I'm trying to enable Dark Mode on emulator (with Android API 28), but after I choose "Dark" Theme on emulator in Settings, enter image description here

nothing is changed, except of setting value:

enter image description here

Is it possible at all to enable Dark Mode on emulator?

1
  • 1
    The result of getNightMode() is always MODE_NIGHT_NO, but it's settable with setNightMode(MODE_NIGHT_YES). Have you figured it out yet?
    – tynn
    Feb 3, 2019 at 17:59

6 Answers 6

25

Answer by @AchrafAmil and @MihailFleytman on Android StackExchange.

No reboot/root required

adb shell "cmd uimode night yes"
adb shell "cmd uimode night no"
16

According to Google

Dark theme is available in Android 10 (API level 29) and higher.

For me, it was easier to install an emulator with API level 29.

It works like a charm.

https://developer.android.com/guide/topics/ui/look-and-feel/darktheme

11

On Android 10 go to Display -> Dark Theme and switch the toogle, in order to activate that.

1

The closest to a system dark theme I achieved on 28 was only for the background of the apps menu (homepage screen) to be either light or dark. And I could only achieve that after I switched to setting "Automatic based on wallpaper", changing wallpaper to a dark, watch it change (see attachments). Then dark and light modes started working as if they were unlocked.

Homescreen in mode dark api 28

Homescreen in mode light api 28

I'd say real system dark theme is only working as intended in preview Q and up. And ofc, apps developed to support dark theme will all the way down to 14.

0

I had this same question. My app detected and applied dark mode fine on an Android 9.0 device, but even with "Dark" theme enabled in the 9.0 emulator, nothing happened, and I initially thought it was broken.

I don't know if the theme setting actually does anything for the earlier emulators, but, yes, the theme setting works as expected on an Android 10.0 emulator as indicated by the other answers.

https://developer.android.com/guide/topics/ui/look-and-feel/darktheme

0

Have you tried to activate the battery saver? If using an android simulator, dark mode will be active after battery saver is activated

I've tried on android simulator Nexus 5x API 28

So the steps are

  1. Settings -> Display -> Advance -> Device Theme -> Select Dark
  2. Activate Battery Saver (Settings -> Battery -> Battery Saver)

Thanks

Reference: developer android dark theme

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.