Open demonguy opened 2 months ago
As this is an error reported by libusb_open
(so the C library directly), the first level of explanation I can give comes from the libusb1 documentation for libusb_open
.
Then, the question becomes: Why does your windows user somehow not have the permission to open that device ?
My first thought was libusb_detach_kernel_driver
(exposed as DeviceHandle.detachKernelDriver
in this module), especially as you mention ADB may be installed on that system (and could hence somehow maybe take precedence over WinUSB ? I'm not sure), but the libusb1 documentation states it is not available on windows.
Searching a bit, I find https://github.com/libusb/libusb/issues/1300 which suggests to me the 32bits library (and hence main executable ?) may somehow not be allowed to open devices running on a 64bits machine. What bit-width the python interpreter you are using is compiled for ?
Another approach to this question: here are two projects which implement the adb command in python, and both happen to use my module to access the USB bus:
https://github.com/google/python-adb (archived)
https://github.com/JeffLIrion/adb_shell (active)
EDIT: ...and I forgot to finish my thought: I'm not suggesting you use these projects' code (though you may decide to), just that they could maybe have bug reports or code which could point you in the direction of how to resolve the present issue.
I tried to use this library to access android devices via python script. So far I can:
adb
toolWinUSB
Did I miss anything?