Search code examples
androidadb

adb screen size changes after reboot


I was testing an app on android device with custom screen sizes with the adb command

adb shell wm size <size>x<size>

and reset it back to normal with

adb shell wm size reset

but now the device is set to some weird resolution after it reboots every time.

Each time it reboots, I need to run the reset command. How to fix this


Solution

  • By running adb shell wm size <size>x<size> the default size of the device is set to size . if you want to revert it to the previous default value, you need to know the size value of the screen before you modified it.

    If you don't know the default size of the adb screen -

    • open android studio
    • click on Device Manager in Slidebar
    • click on 3 dot menu
    • click on Details Or click on Edit
    • from there you can get the size of device.

    After you get or know the size rerun adb shell wm size <size>x<size> with size described above.

    If the above doesn't help do this:

    • click on 3 dots menu
    • click on view details
    • open your avd folder
    • open config.ini and modify according to you
    • also open emulator-user.ini and modify according to you.

    if this doesn't help you might be using an snapshot of the the avd , in that case in the same folder:

    • open snapshot folder
    • your snapshot
    • and configure the hardware.ini according to your needs.