使用 ADB 更改 Android 设备方向 [英] Changing Android Device orientation with ADB

查看:35
本文介绍了使用 ADB 更改 Android 设备方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在真实设备上使用 Android 4.4,我想通过 adb 设置设备方向.我不想用 uiautomator 完成它,因为它不会在 uiautomator 代码终止后持续.

I'm using Android 4.4 on a real device and I want to set the device orientation via adb. I don't want it done with uiautomator since it won't last after the termination of the uiautomator code.

我该怎么做?

推荐答案

你可能需要先关闭自动轮换:

You may first need to turn off the automatic rotation:

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0

旋转到横向:

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1

旋转人像:

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0

这篇关于使用 ADB 更改 Android 设备方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆