Set sensor
set_sensorSet emulated Android sensor values to test accelerometer, gyroscope, orientation, light, or proximity logic. Provide x, y, z for multi-axis sensors or x only for single-value sensors.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sensor": "<sensor>",
"x": "<x>"
},
"name": "set_sensor"
}
}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. |