Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libusb_claim_interface fails on Mac OS X Mountain Lion

I've searched for hours with no avail. I've seen it everywhere that libusb_detach_kernel_driver isn't supported on Mac OS X, but I haven't been able to find a patch or alternative for it.

libusb_claim_interface returns this: libusb: 0.863377 error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access

How can I detach the USB device from the kernel?

like image 550
George Morgan Avatar asked Feb 27 '13 00:02

George Morgan


People also ask

Is Mac OS X Mountain Lion still supported?

Mountain Lion was the last paid upgrade for an OS X major release, with OS X Mavericks and later being free. Apple later allowed free downloads of the OS, especially for customers of older and no longer officially supported Macintosh computers, starting on June 30, 2021.

How do I reinstall Mountain Lion on my Mac?

Reinstalling Mountain LionRestart your computer, and immediately hold down command-r until the gray Apple logo appears. If prompted, select your main language and then click the arrow. Click Reinstall OS X, and then Continue. Follow the instructions on the screen, and then choose your hard disk.

How old is OS X Mountain Lion?

Version 10.8: "Mountain Lion" OS X Mountain Lion was released on July 25, 2012.


1 Answers

Many devices automatically have a driver attached to the USB device they are recognised as by OSX and you will not be able to claim the device unless you force the system to detach the device manually before you can run your code and claim the device. If for example it attached the AppleUSBCDC device to some unique usb device you plugged in you'd have to do:

sudo kextunload -b com.apple.driver.AppleUSBCDC

before running your application which tries to claim the interface.

like image 133
ckolivas Avatar answered Sep 28 '22 04:09

ckolivas