Simulating Android Screen Densities & Resolutions for App Testing

15 min read Learn step‑by‑step how to change Android screen density and resolution without rooting, using ADB, developer options, and OEM settings for reliable app testing. October 13, 2026 07:30 How to Simulate Different Screen Densities and Resolutions on Android for App Testing (No Root)

When you develop or test Android apps, the visual layout can look dramatically different on phones with varied screen densities (dpi) and resolutions. Relying on a single device often hides layout bugs that only appear on low‑dpi tablets or high‑dpi flagship phones. This tutorial shows you how to simulate those environments on the same device without rooting, using ADB commands, the built‑in "Smallest width" setting, and manufacturer‑specific options.

Before you start

  • Backup important data. Changing DPI or screen size can temporarily distort UI elements, making navigation difficult.
  • Ensure the device is charged to at least 50 % or keep it plugged in.
  • Connect the phone to a Wi‑Fi network (no need for mobile data).
  • Install Android Platform‑Tools (ADB) on your computer.
  • Enable Developer options → USB debugging on the phone (Settings > About phone > tap Build number 7 times, then Settings > System > Advanced > Developer options).

Why screen density matters

Android classifies screens by density buckets (ldpi ≈ 120 dpi, mdpi ≈ 160 dpi, hdpi ≈ 240 dpi, xhdpi ≈ 320 dpi, xxhdpi ≈ 480 dpi, xxxhdpi ≈ 640 dpi). The system scales resources (drawables, layout dimensions) according to the current densityDpi value. If an app only uses dp units, it should scale automatically, but many developers still hard‑code pixel values or use images that only exist in certain buckets. Testing across densities helps you spot those issues early.

Method 1 – Changing DPI with ADB

Step 1 – Verify ADB connection

  1. Open a terminal (Command Prompt, PowerShell, or Terminal).
  2. Run adb devices. You should see your device listed as device.
    adb devices
    List of devices attached
    1234567890abcdef    device
  3. If the device shows unauthorized, confirm the USB debugging prompt on the phone.

Step 2 – Check the current density

  1. Run adb shell wm density. The output looks like Physical density: 420 (the value varies by device).

Step 3 – Set a new density

  1. Choose a target density. Common test values:
    • 120 dpi (ldpi) – very low‑resolution phones.
    • 240 dpi (hdpi) – typical mid‑range devices.
    • 480 dpi (xxhdpi) – high‑end flagships.
  2. Execute the command, replacing VALUE with your chosen DPI:
    adb shell wm density VALUE
  3. Immediately after the command, Android will restart the window manager. The screen may flicker for a second.

Step 4 – Verify the change

  1. Run adb shell wm density again. The output should now show Override density: VALUE.
  2. Open any app and observe the scaling. Text and icons should appear larger on a low DPI and smaller on a high DPI.

Step 5 – Reset to the original density

  1. When you finish testing, run:
    adb shell wm density reset
  2. Confirm with adb shell wm density – it should now display Physical density only.

Method 2 – Changing screen resolution (size) with ADB

Resolution defines the absolute pixel dimensions (e.g., 1080×2400). Some apps behave differently when the physical size changes, even if the DPI stays the same. Android’s wm size command lets you simulate a different resolution.

Step 1 – Read the current size

  1. Run adb shell wm size. Example output: Physical size: 1080x2400.

Step 2 – Apply a custom size

  1. Pick a resolution that matches a target device. For a typical 720p phone, use 720x1520.
  2. Run the command:
    adb shell wm size 720x1520
  3. The UI will restart; you may notice black bars or stretched elements – that’s expected.

Step 3 – Confirm the new size

  1. Run adb shell wm size again. The output should read Override size: 720x1520.

Step 4 – Reset to the native resolution

  1. Execute:
    adb shell wm size reset
  2. Verify with adb shell wm size – it should now show only Physical size.

Method 3 – Using the "Smallest width" developer option

Starting with Android 7.0 (Nougat), the system exposes a "Smallest width" setting that effectively changes the logical density without touching the hardware DPI. This method works on any device that shows the option, even if ADB is unavailable.

Step 1 – Reveal the option

  1. Open Settings → System → Advanced → Developer options.
  2. Scroll to Drawing section and locate Smallest width. If it’s hidden, toggle Force activities to be resizable first.

Step 2 – Choose a width value

  1. The default value is usually the device’s actual smallest width in dp (e.g., 360 dp).
  2. Tap the field and enter a lower number (e.g., 320) to simulate a smaller screen, or a higher number (e.g., 480) to simulate a larger tablet‑like screen.
  3. Press OK. The system will apply the change instantly; you may notice UI scaling.

Step 3 – Revert

  1. Tap the field again and restore the original value, or simply toggle the switch off.

Note: Not every OEM exposes this field. Samsung, OnePlus, and Pixel devices typically do; some heavily skinned ROMs hide it.

Method 4 – Manufacturer‑specific screen‑size settings

Some OEM skins ship with a built‑in "Screen resolution" or "Display size" toggle that adjusts both DPI and logical size. These settings are useful when you cannot use ADB (e.g., on a locked‑down work phone).

  • Samsung: Settings → Display → Screen resolution → choose HD (720×1480), FHD (1080×2220), or WQHD (1440×2960). The change takes effect after a short restart.
  • OnePlus: Settings → Display → Screen zoom → drag the slider left (smaller UI) or right (larger UI). This adjusts the logical density.
  • Xiaomi: Settings → Display → Display size → slide to adjust.

These UI options are convenient but often limited to the resolutions the manufacturer programmed. For more granular control, fall back to the ADB methods above.

Verifying the simulated environment

After you apply any of the methods, you’ll want to confirm that the device truly reports the new values. Two quick ways:

  1. Via ADB: adb shell getprop ro.sf.lcd_density returns the current logical density. For resolution, adb shell wm size shows the overridden size.
  2. In‑app: Open the app you’re testing and navigate to a screen that uses density‑specific assets (e.g., an image placed in drawable‑hdpi). If the high‑resolution version appears on a low‑dpi setting, the override worked.

Common pitfalls and troubleshooting

Warning: Changing DPI or size can make the system UI (status bar, navigation buttons) partially invisible on some devices. If you cannot navigate back to Settings, use the following recovery steps.

  • Device becomes unusable after a DPI change
    1. Power off the phone.
    2. Boot into Recovery mode (usually Volume Up + Power).
    3. Select Reboot system now. Android will clear the override on next boot.
  • ADB reports "device unauthorized" after a change
    1. Reconnect the USB cable.
    2. On the phone, tap the Allow USB debugging? prompt and tick "Always allow from this computer".
  • App layout still looks the same
    1. Make sure the app does not force a specific density via android:forceDark or custom Resources overrides.
    2. Clear the app cache (Settings > Apps > [App] > Storage > Clear cache) and relaunch.

Safety considerations

  • Never set a density lower than 80 or higher than 640. Extreme values can break the UI and may require a factory reset.
  • If you are testing on a production device, keep a backup of the original settings (note the original DPI and size) so you can restore them quickly.
  • Changes are per‑boot; a normal reboot restores the physical values unless you used the wm density override, which persists until you run reset.

Putting it all together – A practical workflow

Below is a typical sequence you might follow when testing a new layout:

  1. Connect the phone and verify ADB connectivity.
  2. Record the original DPI and size:
    adb shell wm density
    adb shell wm size
  3. Set a low‑dpi configuration (e.g., 120 dpi) and a small resolution (720×1520) to emulate an entry‑level device.
    adb shell wm density 120
    adb shell wm size 720x1520
  4. Launch the app and run your UI test suite. Note any mis‑aligned buttons or missing assets.
  5. Repeat with a high‑dpi configuration (e.g., 480 dpi) and a larger resolution (1440×3040) to emulate a flagship.
    adb shell wm density 480
    adb shell wm size 1440x3040
  6. When finished, reset both overrides:
    adb shell wm density reset
    adb shell wm size reset
  7. Reboot the device to ensure the system UI returns to its native state.

This loop can be scripted for automated testing, but the manual steps above give you full control and immediate visual feedback.

Conclusion

Simulating different screen densities and resolutions on a single Android device is a powerful, no‑root technique for developers, QA engineers, and power users who want to verify UI robustness. By leveraging ADB’s wm density and wm size commands, the built‑in "Smallest width" developer option, or OEM‑specific display settings, you can reproduce a wide range of device form factors without buying hardware. Remember to back up your original values, stay within safe DPI ranges, and use the troubleshooting steps if the UI becomes unresponsive. With these tools in your toolbox, you’ll catch layout bugs early and deliver a more polished experience to every Android user.

User Comments (0)

Add Comment
We'll never share your email with anyone else.