1

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

I have tried importing the HID Driver Kit Framework into Xcode, but with no luck. Xcode is not able to find HIDDriverKit.h and associated headers. Only if I successfully import the HID Driver Kit I can run some sample codes.

  • You're probably using the wrong type of Xcode build target. If want to use DriverKit, you'll need to create a DriverKit System Extension, not an app or command line utility. For DriverKit, your client will definitely need to apply for entitlements from Apple, and add you to their developer account so you can use their developer certificates. (Note that DriverKit may or may not be the correct choice of technology for your project, you haven't provided enough detail for me to give an opinion on that.) – pmdj Jul 20 '23 at 07:56
  • thank you for the response. I want to use the HID Driver kit to communicate with a custom HID device. Initially I made use of HIDAPI, however the client cannot use the GPL license provided by HIDAPI. I will change the build target and check. – Vishnu Hari Jul 20 '23 at 09:16
  • @pmdj I changed the target and as you said I need the developer (team) account. I can get a developer account. I have already developed a java based utility that runs on Mac. I want my Java app to make use of the HID Driver kit extension to talk with the HID Device. Is this possible? Am I making sense? – Vishnu Hari Jul 20 '23 at 09:33
  • You'll need to use IOKit if you want to communicate with a DriverKit extension directly; I don't know if there are any IOKit wrapper libraries for Java already. If not you may need to use a native interface. Again though, if you've got things working from userspace IOKit, I'm not sure if DriverKit is the correct approach. (Either way, your question isn't particularly suited to Stack Overflow - you're asking about how to architect your driver, rather than solving a specific programming question.) – pmdj Jul 20 '23 at 11:27
  • @pmdj. I understand, thanks for all the input. Appreciate it. – Vishnu Hari Jul 21 '23 at 07:13

1 Answers1

0

I'm not too familiar with DriverKit development either, so I'm not sure this is the best way, but here's what worked for me:

  1. Go to [Your Project] > Targets > [Your DriverKit Extension] > Build Phases > Link Binary With Libraries. Then Click the + button at the bottom of the list. enter image description here

  2. Click "Add Other..." then click "Add Files..." enter image description here

  3. In the file picker, navigate to /System/DriverKit/System/Library/Frameworks/HIDDriverKit.framework. Select the HIDDriverKit.framework folder and click the "Open" button. enter image description here

Now you can import and use the library!

Noah Nuebling
  • 219
  • 2
  • 11