How can I read android smart phone accelerometer or gyroscope date through adb?

Viewed 706

I am trying to get the acceleromter data from my phone through adb is that possible?

1 Answers

To get for instance the accelerometer's sensor values on an Android emulator you can use adb's dumpsys command:

adb shell dumpsys

and look for mLastFilteredX, mLastFilteredY and mLastFilteredZ values under the DisplayRotation/AccelSensorJudge section.

With a real device you can look at last accelerometer/gyroscope events by searching for Accelerometer: last 50 events (Gyroscope: last 10 events) on the dumpsys's output.

Related