openatx / adbutils

pure python adb library for google adb service.
MIT License
736 stars 173 forks source link

Add support for emu command #66

Closed leinardi closed 1 year ago

leinardi commented 2 years ago

I would like to be able to send sensor data to the emulator. From command line I can use something like this to simulate, for example, a 1 second device shake:

adb emu sensor set acceleration 100:100:100; sleep 1; adb emu sensor set acceleration 0:0:0

It would be nice to be able to use adbutils to send this emu commands.

codeskyblue commented 2 years ago

pr welcome. my computer will stuck when run emulator

leinardi commented 1 year ago

I just notice that this is actually doable using adb_output():

device.adb_output(['emu', 'sensor', 'set', 'acceleration', '100:100:100'])
time.sleep(1)
device.adb_output(['emu', 'sensor', 'set', 'acceleration', '0:0:0'])