LibUsb claim interface access denied Java

后端 未结 2 1047
不知归路
不知归路 2021-02-19 06:22

I want to be able to read data from an USB pedometer. I\'m trying this in Java and I\'m using the LibUsb and Usb4Java libraries. I can\'t seem to claim the usb pipe or anything

2条回答
  •  情深已故
    2021-02-19 06:55

    LibUsb needs root permission to access usb devices. In Mac having admin account is not enough to access usb devices. You have to run it as root (admin and root is not same). When I was using it on my Mac (OSX EL Capitan) I was facing the same problem and I thought its the problem with devices or library is not working properly but later i realised that its the problem with permission. Guess your program name is myDevicesAccessor then run it like this.

    sudo ./myDevicesAccessor
    

    If you try it like

    ./myDevicesAccessor
    

    It won't work.

提交回复
热议问题