1.命令
1.修改為指定分辨率
adb shell wm size 1136x2480
2.恢復(fù)為默認(rèn)分辨率
adb shell wm size reset
2.可能遇到的問(wèn)題
java.lang.SecurityException: Must hold permission android.permission.WRITE_SECURE_SETTINGS
at android.os.Parcel.readException(Parcel.java:1718)
at android.os.Parcel.readException(Parcel.java:1671)
at android.view.IWindowManagerProxy.setForcedDisplaySize(IWindowManager.java:1401)
at com.android.commands.wm.Wm.runDisplaySize(Wm.java:164)
at com.android.commands.wm.Wm.onRun(Wm.java:87)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
at com.android.commands.wm.Wm.main(Wm.java:46)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:379)
3.解決辦法
打開開發(fā)者模式中USB權(quán)限設(shè)置,如下圖