You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
The following snippet crashes when trying to connect to the adb using tcp
from adb_shell.adb_device import AdbDeviceTcp
from adb_shell.auth.sign_pythonrsa import PythonRSASigner
adbkey = r'path/to/adbkey'
with open(adbkey) as f:
priv = f.read()
with open(adbkey + '.pub') as f:
pub = f.read()
signer = PythonRSASigner(pub, priv)
device1 = AdbDeviceTcp('127.0.0.1', 5553, default_transport_timeout_s=9.)
device1.connect(rsa_keys=[signer], auth_timeout_s=0.1)
And this is the traceback that I'm getting:
Traceback (most recent call last):
File "c:\temp\adbtest.py", line 15, in <module>
device1.connect(auth_timeout_s=0.1)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\adb_shell\adb_device.py", line 219, in connect
cmd, arg0, arg1, banner = self._read([constants.AUTH, constants.CNXN], adb_info)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\adb_shell\adb_device.py", line 754, in _read
cmd, arg0, arg1, data_length, data_checksum = unpack(msg)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\adb_shell\adb_message.py", line 122, in unpack
raise ValueError('Unable to unpack ADB command. (length={})'.format(len(message)), constants.MESSAGE_FORMAT, message, e)
ValueError: ('Unable to unpack ADB command. (length=0)', b'<6I', b'', error('unpack requires a buffer of 24 bytes'))
When connecting through my adb client, I'm given the following error message:
adb server version (31) doesn't match this client (41); killing...
When testing the connection to an updated server (My 10 android phone) it all worked fine (Tested using the mentioned snippet and also an adb.exe client)
Which makes me think that the problem is caused by an unsupported old version of the server.
Given I cannot update the server adb version, how can I make the code compatible with the old version server?
The text was updated successfully, but these errors were encountered:
The following snippet crashes when trying to connect to the adb using tcp
And this is the traceback that I'm getting:
When connecting through my adb client, I'm given the following error message:
When testing the connection to an updated server (My 10 android phone) it all worked fine (Tested using the mentioned snippet and also an adb.exe client)
Which makes me think that the problem is caused by an unsupported old version of the server.
Given I cannot update the server adb version, how can I make the code compatible with the old version server?
The text was updated successfully, but these errors were encountered: