When developing an app that has both a dark and a light theme. I often find myself switching between dark and light mode to see how the UI looks. Previously I've been doing the toggling manually via Quick Settings.
However I recently found out that you can toggle between modes via adb (Stack Overflow)
So I made a simple shell script that toggles between modes.
How to use:
- Save this to a file, e.g.
toggle_dark_mode.sh
- Make it executable
chmod +x toggle_dark_mode.sh
- (Optional) make an alias in your .bashrc/.zshrc file:
alias toggle_dark_mode="PATH_TO_SCRIPT/toggle_dark_mode.sh"
- Usage:
./toggle_dark_mode