A library that makes it easy for python to communicate with ADB.
Let's instantiate the Base class:
from commands import Base
base = Base()
Now we can use your methods.
Execute an adb command(this command will restart your device)
base.execute('reboot')
If you prefer to specify a device:
base.execute('shell', device=base.treat_device('<device_id>'))
treat_device is required because it treats the string before it can be added to the command. Exemple:
print(base.treat_device('<device_id>'))
The return will be: -s <device_id>
Returns a list of all plugged in devices.
print(base.devices())
as an example returns ['device_id', 'device_id2']
This class is used to execute rotary commands. Let's instantiate the class BaseCommand:
from commands import BaseCommand
baseCommand = BaseCommand()
This command types specified text directly into the device:
baseCommand.input_text('Text example')
This library is still in beta, I'm working to improve every day. My goal is to make it as simple and abstract as possible.