获取当前方向一:

adb shell "dumpsys input | grep SurfaceOrientation"
#         纵向(正常状态:顺时针旋转0°):SureaceOrientation 的值为 0
#         横向(顺时针旋转90°):        SureaceOrientation 的值为 1
#         纵向(顺时针旋转180度):      SureaceOrientation 的值为 2
#         横向(顺时针旋转270度):      SureaceOrientation 的值为 3

注意: 默认0有的为横向,有的为纵向

获取当前方向二:

adb shell "dumpsys window displays|grep init="

纵向返回结果:cur的值 短 x
init=1080x1920 420dpi cur=1080x1920 app=1080x1794 rng=1080x1017-1794x1731
横向返回结果:cur 的值 长 x
init=1080x1920 420dpi cur=1920x1080 app=1794x1080 rng=1080x1017-1794x1731

旋转屏幕

#禁止旋转
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 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 shell settings put system user_rotation 1
#屏幕正常模式
adb shell settings put system user_rotation 0

android 通过adb shell命令旋转Android屏幕朝向相关推荐

  1. android ADB shell 命令启动 android程序

    今天用eclipase写了个android程序,主要用到了service.activity.broadcast,在安卓系统手机上调试通过,现在想用ADB shell命令启动这个程序,使达到的效果和在e ...

  2. Android SDK: adb shell 命令的使用(am、pm、wm、screencap、monkey等)

    本文链接: https://blog.csdn.net/xietansheng/article/details/86675136 adb其他命令介绍详见上一篇: Android SDK: adb 常用 ...

  3. Android 常用adb shell 命令

    原文地址http://blog.csdn.net/rain_butterfly/article/details/40894807 调试Android程序有时需要adb shell 命令,adb全称An ...

  4. Android常用adb shell命令

    1.显示应用版本信息 dumpsys package com.flyzebra.app | grep version 2.显示应用安装路径 pm path com.flyzebra.app 或者 pm ...

  5. adb shell 命令打开android系统的开发者选项界面

    adb shell am start -n com.android.settings/com.android.settings.DevelopmentSettings

  6. adb shell命令_[Android]adb的使用

    什么是ADB: Android-debug-bridge(简称ADB),命令行工具,可以与android设备进行通信. 安装ADB: 直接安装: sudo apt-get install adb 下载 ...

  7. android afw 权限,如何从adb shell命令启动AFW徽章应用程序?

    我无法启动Android从Adb shell命令启用工作的应用程序? 有人可以举个例子吗? 请参阅附加屏幕,我想启动Playstore应用程序. 没有徽章ICON Play商店应用程序也具有与Badg ...

  8. 学习转载:Android中常用shell命令详解

    https://blog.csdn.net/Z_HUALIN/article/details/77878609 设置adb环境变量 其实就是将adb.exe的路径放到Path中,目的是cmd直接可以使 ...

  9. android 常用adb 和 adb shell 命令 获取root权限

    android 常用adb 和 adb shell 命令 ADB常用命令:   1. 查看设备 adb  devices 这个命令是查看当前连接的设备, 连接到计算机的android设备或者模拟器将会 ...

最新文章

  1. 什么是采样层(pooling)
  2. swift string,Int,Double相互转换
  3. Galaxy 生信平台(二):生产环境部署
  4. 青源Forum | 人工智能的数理基础前沿系列报告 · 第 3 期
  5. NTFS的交换数据流ADS应用
  6. MySQL—04—MySQL的其他对象
  7. unity 开发总结
  8. python安装第三方库win10_音频处理 windows10下python三方库librosa安装教程
  9. Kafka是靠什么机制保持高可靠,高可用的?
  10. java正则表达式及api_Java API 之 正则表达式
  11. 高性能高可靠性的全数字嵌入式仿真测试软件SkyEye
  12. 国际电汇的清算代码是什么?
  13. 面向对象的编程-类和实例
  14. w7设置双显示器_怎么在windows7系统下设置双显示器
  15. Python+Visual Studio
  16. div探索系列(二):让多个div显示在一行(浮动的div)
  17. win10 64位下Oracle10g安装
  18. mac os安装Windows系统失败后不能合并为一个分区
  19. STM32芯片无法下载 芯片锁死 M3错误的一种解决方案
  20. 查看电脑开机关机记录

热门文章

  1. 阿里巴巴获得商品详情 API调用示例
  2. python调用阿里API车牌识别接口步骤
  3. Python爬虫入门教程 61-100 写个爬虫碰到反爬了,动手破坏它!
  4. 星座夫妻(真的很准)
  5. 基于VUE + Echarts 实现可视化数据大屏展示效果
  6. 新型微框架磁悬浮飞轮用洛伦兹力磁轴承
  7. Html5---鸟巢
  8. UC提速游戏战略:分成3亿追击腾讯
  9. [code] PTA 胡凡算法笔记 DAY005
  10. SU-8 光刻胶曝光时间的确定