How to Change Screen Resolution and Density on Android Using ADB wm Commands

Delivering consistent user interfaces across the vast Android hardware ecosystem requires verifying layouts across diverse screen sizes and display densities. An interface designed on a standard 1080p smartphone display may suffer from clipped text on budget 720p screens, excessive whitespace on 1440p flagships, or cramped navigation controls on high-DPI foldables and tablets.

While testing across dozens of physical devices is costly and launching heavy emulator instances is resource-intensive, Android Debug Bridge (ADB) provides a powerful command-line solution: the Window Manager (wm) utility. Developers can dynamically change the active display resolution and density (DPI) on any connected Android device or emulator at runtime without rebooting.

Auditing Native Screen Resolution and Density

Connect your Android device with USB Debugging enabled, open a terminal, and query the current display parameters:

# Query physical screen resolution (width x height in pixels)
adb shell wm size

# Query physical display density (DPI)
adb shell wm density

The terminal outputs the hardware baseline:

Physical size: 1080x2400
Physical density: 420

Simulating Different Screen Resolutions (wm size)

To evaluate how UI layouts scale to lower-resolution or higher-resolution displays, override the active screen dimensions using wm size <width>x<height>:

# Simulate standard 720p HD display
adb shell wm size 720x1600

# Simulate compact 1080p display
adb shell wm size 1080x1920

# Simulate wide 1440p QHD+ display
adb shell wm size 1440x3120

The Android display compositor immediately resizes the viewport in real time. Notice how your application’s responsive constraints, flexboxes, and RecyclerView spans adjust dynamically to the modified viewport.

Overriding Pixel Density and DPI Scaling (wm density)

Display density determines the mapping between density-independent pixels (dp) and physical screen pixels (px). Adjusting density allows you to test extreme accessibility display scaling and compact tablet ergonomics:

# Simulate high-density compact UI (tablet-style UI scaling)
adb shell wm density 280

# Simulate low-density enlarged UI (testing large accessibility text scaling)
adb shell wm density 560

Testing with an elevated density (e.g., 560 DPI) is especially valuable for detecting truncated labels, broken dialog layouts, and overlapping buttons that occur when users increase display size in system accessibility settings.

Simulating Display Cutouts and Camera Notches

Modern Android versions include command-line overlays to simulate various camera cutouts, notches, and punch-holes:

# Emulate tall display notch
adb shell cmd overlay enable com.android.internal.display.cutout.emulation.tall

# Emulate corner punch-hole camera
adb shell cmd overlay enable com.android.internal.display.cutout.emulation.corner

# Emulate double notch (top and bottom)
adb shell cmd overlay enable com.android.internal.display.cutout.emulation.double

Verify that your application respects WindowInsets and does not position interactive controls beneath the camera cutout.

Resetting Display Settings to Factory Hardware Defaults

Once UI verification is complete, return the device to its native hardware settings:

# Reset screen resolution to physical default
adb shell wm size reset

# Reset screen density to physical default
adb shell wm density reset

# Disable display cutout emulation overlays
adb shell cmd overlay disable com.android.internal.display.cutout.emulation.tall
adb shell cmd overlay disable com.android.internal.display.cutout.emulation.corner

Tip: Always execute the reset commands after automated testing scripts finish, ensuring devices remain in their standard operational state for subsequent tests.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.