Is it possible to check a devices orientation via ADB?
Not by installing any software, calling any existing software, just through ADB. Would guess there is a status file somewhere in /proc
, but could not find it yet.
This can be done through the following command:
adb shell dumpsys | grep 'SurfaceOrientation' | awk '{ print $2 }'
The output will be an integer ranging from 0 to 3 for each of the four possible orientations. 0 and 2 are landscapes while 1 and 3 are portraits. As the dumpsys
output is very large, the command might take a few seconds to complete.
Update: dgmltn's modification is likely much faster:
adb shell dumpsys input | grep 'SurfaceOrientation' | awk '{ print $2 }'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With