Check for terrain through ADB

Can I check device orientation via ADB?

Not by installing any software that invokes any existing software, only through ADB. Suppose there is a status file somewhere in /proc, but he has not found it yet.

+5
source share
3 answers

This can be done using the following command:

adb shell dumpsys | grep 'SurfaceOrientation' | awk '{ print $2 }'

The output will be an integer from 0 to 3 for each of the four possible orientations. 0 and 2 are landscapes, and 1 and 3 are portraits. Since the output is dumpsysvery large, the command may take a few seconds.

Update: Perhaps dgmltn change is much faster:

adb shell dumpsys input | grep 'SurfaceOrientation' | awk '{ print $2 }'
+8
source

Simplified solution:

adb shell dumpsys window | grep -i surfaceorientation | awk '{ print $2 }'
0

content query --uri content://settings/system --projection name:value --where "name='user_rotation'" adb shell. , , , .

0

All Articles