0

Is possible to simulate an event on a Android real device?

More precisely, I want to test an application which does something if a particular temperature value is detected. Is there an adb command, or somethings else, to send a fake sensor value to the device in order to check the application behaviour?

Thanks.

3

1 Answer 1

0

Specifically what sensor ? If you are simulating a screen press, then yes.

If you are simulating a temperature for your CPU, probably not.

It depends on the level of safety In my opinion, if your just mocking GPS locations, not a big problem... However if your trying to mock temperature readings or something that might cause hardware failure's... it may not be possible.

4
  • Unfortunately I would be interested at temperature and pressure sensors.
    – matz_
    Feb 24, 2019 at 22:48
  • I'm fairly sure for user safety reasons, that this is the hardest form of sensor data mocking. Feb 24, 2019 at 23:22
  • For example, a CPU set to 0° temperature, could potentially expose your lithium based battery to unnecessary heat, that could potentially end in a life threatening situation or an extremely dangerous one... Lithium mixed with oxygen creates explosive gas, the heat source ( CPU ) is usually directly under the battery compartment and ... If the correct situations are met, goodbye hand, or face, or stomach... i personally was interested in a CPU Cooking software that I was trying to build for tests, however it's extremely hard to mock temperature readings... Pressure readings may also be risky Feb 24, 2019 at 23:27
  • I understand the subject, but I don't think that the environmental temperature may be cause this problem, but i don't understand why Google doesn't provide some way to simulate these values as well.
    – matz_
    Feb 24, 2019 at 23:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .