importing HID Driver Kit Framework

Hi everyone,

I am fairly new to Apple development. I have been working on a project where I need Mac to interface with an HID device (custom device). I have successfully communicated with the device using IOKit, Core Foundation and Driver Kit frameworks by simply importing these frameworks in the project and making use of their APIs.

However, my client is now asking that I develop the communication explicitly using HID Driver Kit. Bear in mind that I have not purchased the apple developer certificate nor do I have any provisional signing certificates and without any of these, Xcode was allowing me to use frameworks like IOKit, DriverKit etc.

Now, when I tried importing HIDDriverKit into the project, I am not able to find this framework in the "Frameworks and Libraries" tab. How do I import this framework into my project? Do I have to purchase apple developer ID or get the provisional signing certificates or any other formalities are required? Please let me know what can be done. Any pointers or suggestions are welcome.

Best,

Vishnu

Replies

There are two incarnations of HIDDriverKit:

  • In the macOS SDK, there is MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/HIDDriverKit/

  • In the DriverKit SDK, there is DriverKit.sdk/System/DriverKit/System/Library/Frameworks/HIDDriverKit.framework

Neither of these can be imported into a standard Mac app. The first is part of the Kernel pseduo-framework, meaning that’s intended for folks implementing a KEXT. The second is for the DriverKit platform, which is a completely separate platform than the macOS platform used by Mac apps.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you for the response.

When you say "Neither of these can be imported into a standard Mac app", what does that mean?

My use case is to develop a C/C++ project that needs to make use of APIs from HIDDriverKit. Bottom line: It need not be a Mac App (as such). I just want an executable that can be run on Mac (I intend to run this from a command line or from a java application). Could you tell me how this can be achieved. I mean if it is not too much to ask, maybe you could provide me with a basic workflow on how to setup the project on Xcode.

Regards,

Vishnu

When you say "Neither of these can be imported into a standard Mac app", what does that mean?

Well, that was a simplification. More accurately, it’s “standard user space code on the Mac”. Specifically:

  • KEXTs are kernel extensions, which means they run as plug-ins within the kernel.

  • DEXTs are kinda like the modern replacement for kernel extensions. They don’t run in the kernel per se, but they also aren’t standard user space code.

You wrote this:

I have successfully communicated with the device using IOKit, Core Foundation and Driver Kit frameworks by simply importing these frameworks in the project and making use of their APIs.

and this:

However, my client is now asking that I develop the communication explicitly using HID Driver Kit.

Perhaps you can get your client to explain why they want you to be doing here? Because, as written, this suggests that your client wants you ship a KEXT or a DEXT, which is going to make your life much harder.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"