- 为了适配不同尺寸屏幕的手机,最简单的方式就是通过adb修改分辨率和dpi
adb安装
adb官网下载
adb修改size
- 查看分辨率
C:\Users\54013>adb shell wm sizePhysical size: 1080x2340
- 修改分辨率
C:\Users\54013>adb shell wm size 1080x1920C:\Users\54013>adb shell wm sizePhysical size: 1080x2340Override size: 1080x1920
adb修改dpi
- 查看dpi
C:\Users\54013>adb shell wm densityPhysical density: 480
- 修改dpi
C:\Users\54013>adb shell wm density 320C:\Users\54013>adb shell wm densityPhysical density: 480Override density: 320
adb恢复默认设置
- 恢复默认的size和dpi
C:\Users\54013>adb shell wm size resetC:\Users\54013>adb shell wm density reset
参考文献
来源地址:https://blog.csdn.net/yu540135101/article/details/127294377