adb命令控制横/竖屏切换

在网络上查找了一下使用adb命令来控制真机的横竖屏的命令,普遍找到的结果是:

adb shell service call window 2013 i32 0(设置横屏)

adb shell service call window 2013 i32 1(设置竖屏)

但是在真机(root过)上测试普遍没有通过,会有出错信息。(Result: Parcel(Error: 0xffffffb6 "Not a data message"))

查看一下service的使用说明

adb shell service --help

unknown option -- -unknown option -- eunknown option -- lunknown option -- pUsage: service [-h|-?]

service list

service check SERVICE

service call SERVICE CODE [i32 INT | s16 STR] ...

Options:

i32: Write the integer INT into the send parcel.

s16: Write the UTF-16 string STR into the send parcel.

首先,service list很明显就是查看service列表啦!

其次,service check SERVICE就是检测服务是否存在啦!

最后,service call SERVICE CODE [i32 INT | s16 STR] ...SERVICE可从

经验分享 程序员 微信小程序 职场和发展