Background Information In the macOS operating system environment, Program A uses libusb to access USB devices that comply with the USB Mass Storage protocol. To enable Program A to start automatically after macOS boots, its corresponding plist file has been placed in the /Library/LaunchDaemons directory. Problem and Phenomenon Description Program A works well on macOS versions prior to 15.3, and it can access USB devices normally. However, on macOS 15.3, the following abnormal situations have occurred: A. Program A launched by launchd cannot access the USB device. Checking the logs reveals that the IOCreatePlugInInterfaceForService call in the darwin_claim_interface function returns the error code e00002be. B. Program A launched from the terminal command line with sudo privileges can access the USB device normally, and the return value of the IOCreatePlugInInterfaceForService call is 0.
Lots of questions on this:
-
What hardware are you actually matching against and getting this error from?
-
Have you compared the IORegistry between 15.2 and 15.3 looking for differences in the driver stack loading on this device?
-
What are you actually using the IOUSBInterface "for"? Are you sure you can't get the same information from the IORegistry itself?
-
Have you tried using the IOUSBHost framework instead? That framework was released in macOS 10.15 as the replacement for IOUSBLIb and should provide the same functionality with a far nicer API.
-
What's being logged at the time the failure occurs?
-
What happens if you retry a second or so later? Note that I mean simply calling the function again, not hotplugging the device.
-
Related to that last point, have you tested your daemon at hot plug time as well as during startup?
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware