adb shell 横屏
时间: 2023-09-08 18:09:44 浏览: 136
adb取安卓模拟器点击坐标-易语言
要在adb shell中查看设备的横屏状态,可以使用以下命令:
adb shell "dumpsys input | grep SurfaceOrientation"
如果你只想获取横屏状态的数值,可以使用以下命令:
adb shell "dumpsys input|grep SurfaceOrientation|awk '{ print $2}'"
另外,你也可以使用脚本来循环获取横屏状态的值,如下所示:
```
#!bin/bash
count=0
while [ "$count" -lt 1000 ]; do
echo "$count"
adb shell service call window "$count" i32 0
count=$(($count + 1))
done
```
上述脚本将循环调用`adb shell service call window`命令,并在每次循环中打印出横屏状态的值。你可以根据需要进行修改和调整。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [使用adb命令判断Android屏幕是否横向或纵向](https://blog.csdn.net/qq_36514470/article/details/124276946)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [adb命令控制横/竖屏切换](https://blog.csdn.net/czc0000000/article/details/84180763)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文