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

AdbDeviceUsb not working with MacOS X due to error 'LIBUSB_ERROR_ACCESS [-3]' #208

Open
truebit opened this issue Sep 2, 2022 · 2 comments

Comments

@truebit
Copy link

truebit commented Sep 2, 2022

Description

connect to an USB Android device on Mac OS X failed:

signer = PythonRSASigner(pub, priv)
d = AdbDeviceUsb(serial='f3ee4049') # or without serial parameter
d.connect(rsa_keys=[signer], auth_timeout_s=0.1)

Log

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/adb_shell/adb_device.py", line 675, in connect
    self._available, self._maxdata = self._io_manager.connect(self._banner, rsa_keys, auth_timeout_s, auth_callback, adb_info)
  File "/usr/local/lib/python3.10/site-packages/adb_shell/adb_device.py", line 221, in connect
    self._transport.connect(adb_info.transport_timeout_s)
  File "/usr/local/lib/python3.10/site-packages/adb_shell/transport/usb_transport.py", line 242, in connect
    transport.detachKernelDriver(iface_number)
  File "/usr/local/lib/python3.10/site-packages/usb1/__init__.py", line 1199, in detachKernelDriver
    mayRaiseUSBError(
  File "/usr/local/lib/python3.10/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
    __raiseUSBError(value)
  File "/usr/local/lib/python3.10/site-packages/usb1/__init__.py", line 119, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorAccess: LIBUSB_ERROR_ACCESS [-3]
@truebit
Copy link
Author

truebit commented Sep 23, 2022

if I ran the above python script with sudo. the device would connect successfully.

I think this should be related to libusb/libusb#1014

@YSaxon
Copy link

YSaxon commented Dec 21, 2023

try adb kill-server

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