set_sensor
Set emulated sensor values on an Android emulator to test accelerometer, gyroscope, light, proximity, and other sensor-driven behaviors using adb.
Instructions
Set an emulated hardware sensor value (adb emu sensor set) — drive accelerometer/gyroscope/orientation (pass x, y, z) or a single-value sensor like light/proximity/temperature/pressure/humidity (pass x only). Use to exercise shake/tilt/rotation handlers or ambient-light/proximity logic. Emulator-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | First value (the only value for single-axis sensors like light/proximity). | |
| y | No | Second value for multi-axis sensors. Omit for single-value sensors. | |
| z | No | Third value for multi-axis sensors. Omit for single-value sensors. | |
| sensor | Yes | Sensor name, e.g. acceleration, gyroscope, magnetic-field, orientation (3 values) or light, proximity, temperature, pressure, humidity (1 value). | |
| serial | No | Target device serial (adb -s). Optional when exactly one device is attached. |