-1

Is there any command to perform sensor event in device using monkey or adb like using monkey we can perform so many commands for touch long press etc.but i am not getting any sensor commands

Does anyone have idea about this please share.

Thanks in advance

ankita gahoi
  • 1,532
  • 2
  • 15
  • 28

1 Answers1

0

You can inject events using adb shell sendevent command. Name of the device to send the events to is going to be device specific (actually it could change with software upgrade on the same hardware). You can get a list of the devices with getevent -il

Another option would be to use some low-level development tool to send I2C messages (most sensors sit on I2C bus).

The problem is that while you can inject the extra events - it would not stop the actual sensor from sending its own. So your fake sensor reading would only last till the next real update.

Alex P.
  • 30,437
  • 17
  • 118
  • 169