Set screen minimum width to 400dp

by Manaquri Azertyuio

Version 1 (March 23, 2024)

Download (98 downloads)

Sets the screen minimum width in the developer options.

Needs the write secure settings permission, use adb shell with "pm grant com.llamalab.automate android.permission.WRITE_SECURE_SETTINGS"
You can use a flow with adb to send the command, or adb shell {command} on a computer.

The formula for display width to density is 172 800/dp, so if you want 600 dp smallest width, set to 172800/600 = 288

Directly setting display_density_forced doesn't refresh the ui, so adb is needed.

Note that turning adb wifi on and off is a workaround because some phones only advertise adb for a short time after it's enabled.

You can also use this script as a base to automate other adb functions