Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since 2.6.0, shell command with serial on ubuntu system will raise adbutils.errors.AdbError: unknown host service #130

Open
yinkh opened this issue May 31, 2024 · 1 comment

Comments

@yinkh
Copy link
Contributor

yinkh commented May 31, 2024

import adbutils
import os
port = int(os.getenv('ANDROID_ADB_SERVER_PORT', 5037))
client = adbutils.AdbClient(host="127.0.0.1", port=port)
serial = '7aa358b3'
#device = client.device(serial)
device = client.device_list()[0]
package_list = device.list_packages()
print(package_list)

will get error:

Traceback (most recent call last):
  File "/home/opt//demo.py", line 8, in <module>
    package_list = device.list_packages()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/opt//venv/lib/python3.11/site-packages/adbutils/shell.py", line 250, in list_packages
    output = self.shell(["pm", "list", "packages"])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/opt//venv/lib/python3.11/site-packages/adbutils/_device.py", line 192, in shell
    c = self.open_transport(timeout=timeout)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/opt//venv/lib/python3.11/site-packages/adbutils/_device.py", line 90, in open_transport
    c.check_okay()
  File "/home/opt//venv/lib/python3.11/site-packages/adbutils/_adb.py", line 147, in check_okay
    raise AdbError(self.read_string_block())
adbutils.errors.AdbError: unknown host service

downgrade to 2.5.0 is good. and same code and same adbutils on windows is good.

windows adb server version is Android Debug Bridge version 1.0.41
ubuntu adb server version is Android Debug Bridge version 1.0.39

image
this code cause new bug

@harveyxie22
Copy link

The same error happened to me in my local environment (Ubuntu 20.04). Please help us, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants