Skip to main content
Use device.adb(...) to send adb emu sensor set commands during a flow. This lets you simulate hardware sensor input and test how your app responds.
See the Android emulator sensor documentation for available sensor names and value formats.
Sensor commands affect the emulator’s sensor state directly. They work on emulators only — not physical devices.

Examples

Accelerometer
Gyroscope
Light
Pressure

When to use

  • Your app responds to device tilt or motion and you need to test that behavior.
  • Your app adjusts UI based on ambient light levels.
  • Your app reads barometric pressure for altitude or weather features.
  • Your app uses gyroscope data for orientation or gesture detection.
Last modified on June 4, 2026