When developing or testing Android apps, you often need to see how the UI behaves on screens with different densities (dpi) and resolutions. Buying a whole fleet of devices is impractical, but Android already ships a hidden setting that lets you simulate other screens on a single device. This tutorial shows exactly how to enable and use that feature without rooting your phone.
Settings.About phone (or System > About device on some OEM skins).Build number and tap it seven times. You’ll see a toast saying “You are now a developer!”.Developer options should appear, usually under System or at the bottom of the list.If your device asks for a PIN or pattern after enabling Developer Options, enter it to unlock the new menu.
Settings → System → Developer options.Smallest width. (On some devices the entry is called Minimum width or Screen density.)dp (density‑independent pixels).The default value matches the device’s native density. For example, a Pixel 5 with a 440 dpi screen shows 411dp as the smallest width.
Android calculates the dp value from the physical screen size and the current density. To simulate a denser or sparser screen you simply change the number:
411dp to 600dp) makes UI elements appear smaller, as if the screen were higher‑density.300dp) makes UI elements appear larger, mimicking a lower‑density screen.Typical values for common densities are:
| Density (dpi) | Typical smallest‑width (dp) |
|---|---|
| ldpi (~120) | 320dp |
| mdpi (~160) | 360dp |
| hdpi (~240) | 480dp |
| xhdpi (~320) | 560dp |
| xxhdpi (~480) | 720dp |
| xxxhdpi (~640) | 960dp |
Pick a value that matches the density you want to test. For example, to emulate a typical 1080p phone (xxhdpi), set the smallest width to 720dp.
If the UI becomes unusably tiny, simply repeat Step 3 with a lower number. The change is reversible at any time.
Android also offers a separate Display size slider (Settings > Display > Display size). This setting scales the entire UI in addition to the density change. Using both together gives you a matrix of possible configurations:
Experiment with combinations to match the exact target device you are emulating.
Developer options → Smallest width.Display size, move the slider back to the middle (or the “Default” label).After a short refresh you’ll be back to the factory‑default UI.
If the smallest‑width value is set too high, text and buttons shrink beyond the minimum readable size. In that case, press the power button to turn the screen off, then quickly press the volume up/down keys to wake it. If you can’t interact at all, use adb to reset the setting:
adb shell settings put global smallest_width 0
This command forces Android to ignore the custom value and revert to the default.
Certain apps declare android:anyDensity="false" in their manifest, which tells Android to keep their UI at the original density. There’s no user‑level workaround for those apps; you’ll need to test on a real device or an emulator that matches the target density.
A few OEM skins (especially heavily customized ones) trigger a soft reboot when the density is altered. This is normal – the system is re‑initialising resources. After the reboot, verify the new density using Settings > About phone > Hardware information or by running:
adb shell wm density
The command should return the current density in dpi.
Developer Options expose a privileged system service (WindowManager) that accepts a runtime density override. Because the change is applied at the framework level, it does not require write access to /system. Android treats the override as a user‑specific configuration, which is why it can be toggled on the fly and safely reverted.
anyDensity flag.Remember that this method only affects how Android draws the UI; it does not change the physical pixel count of the screen. For pixel‑perfect graphics testing, an emulator or a real device with the target resolution is still recommended.
By enabling Developer Options and adjusting the Smallest width value, you can safely simulate a wide range of screen densities and resolutions on any Android phone – all without rooting. Combine the setting with the built‑in Display size slider for even finer control, and always keep a backup of your original configuration. This lightweight workflow gives developers and power users a fast, repeatable way to validate UI designs across the fragmented Android ecosystem.









