Closed enty8080 closed 3 years ago
shell()
calls?
while True:
command = input("adb # ")
if command == "exit":
break
resp = device.shell(command)
if resp:
print(resp)
pm install -r /sdcard/Download/something.apk
device.shell("reboot")
. 1. Okay, but interactive shell is not just a wrapper, its a wrapper, but with some extra functions:
2. Okay, I read about it.
3. No, reboot is not a shell command:
This should accomplish reboot:
device._open(b'reboot:', transport_timeout_s, read_timeout_s, timeout_s)
Can you please confirm that it works.
@JeffLIrion Sorry for late response. Yes, it works fine for me, thank you.
OK, I'll merge the corresponding pull request.
I don't intend to implement items 1 and 2, as the scope of this package is to implement the ADB protocol, not to provide utilities and helper functions. I don't want to clutter the AdbDevice
and AdbDeviceAsync
classes. That said, I think the following approach would be reasonable, if you'd like to contribute it.
Implement an AdbDeviceUtils
class that looks like:
class AdbDeviceUtils:
def __init__(self, adb_device):
self._adb_device = adb_device
def install(self, apk, ...):
self._adb_device.shell("<install command>", ...)
AdbDevice
class:
@property
def utils(self):
return AdbDeviceUtils(self)
Then you could do device.utils.install(...)
.
And do the same for the AdbDeviceAsync
class.
Hello
adb_shell
developers,I would like to ask about adding interactive shell to adb_shell project. I think it will be good for people who does not want to send commands manually through
device.shell()
.result:
.apk
files on devices.Regards, Ivan Nikolsky (@enty8080)
P.S. I am using your python package and it is very good :), so it will be good to see this features.