Can't get USBSerialDriverKit driver loaded

I am writing a DriverKit driver for the first that uses the USBSerialDriverKit. The driver its purpose is to expose the device as serial interface (/dev/cu.tetra-pei0 or something like this). My problem: I don't see any logs from that driver in the console and I tried like 40 different approaches and checked everything. The last message I see is that the driver get successfully added to the system it is in the list of active and enabled system driver extensions but when I plug the device in none of my logs appear and it doesn't show up in ioreg. So without my driver the target device looks like this:

+-o TETRA PEI interface@02120000  <class IOUSBHostDevice, id 0x10000297d, registered, matched, active, busy 0 (13 ms), retain 30>
  | {
  |   "sessionID" = 268696051410
  |   "USBSpeed" = 3
  |   "UsbLinkSpeed" = 480000000
  |   "idProduct" = 36886
  |   "iManufacturer" = 1
  |   "bDeviceClass" = 0
  |   "IOPowerManagement" = {"PowerOverrideOn"=Yes,"DevicePowerState"=2,"CurrentPowerState"=2,"CapabilityFlags"=32768,"MaxPowerState"=2,"DriverPowerState"=0}
  |   "bcdDevice" = 9238
  |   "bMaxPacketSize0" = 64
  |   "iProduct" = 2
  |   "iSerialNumber" = 0
  |   "bNumConfigurations" = 1
  |   "UsbDeviceSignature" = <ad0c16901624000000ff0000>
  |   "USB Product Name" = "TETRA PEI interface"
  |   "locationID" = 34734080
  |   "bDeviceSubClass" = 0
  |   "bcdUSB" = 512
  |   "USB Address" = 6
  |   "kUSBCurrentConfiguration" = 1
  |   "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBHostFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
  |   "UsbPowerSinkAllocation" = 500
  |   "bDeviceProtocol" = 0
  |   "USBPortType" = 0
  |   "IOServiceDEXTEntitlements" = (("com.apple.developer.driverkit.transport.usb"))
  |   "USB Vendor Name" = "Motorola Solutions, Inc."
  |   "Device Speed" = 2
  |   "idVendor" = 3245
  |   "kUSBProductString" = "TETRA PEI interface"
  |   "kUSBAddress" = 6
  |   "kUSBVendorString" = "Motorola Solutions, Inc."
  | }
  | 
  +-o AppleUSBHostCompositeDevice  <class AppleUSBHostCompositeDevice, id 0x100002982, !registered, !matched, active, busy 0, retain 5>
  |   {
  |     "IOProbeScore" = 50000
  |     "CFBundleIdentifier" = "com.apple.driver.usb.AppleUSBHostCompositeDevice"
  |     "IOProviderClass" = "IOUSBHostDevice"
  |     "IOClass" = "AppleUSBHostCompositeDevice"
  |     "IOPersonalityPublisher" = "com.apple.driver.usb.AppleUSBHostCompositeDevice"
  |     "bDeviceSubClass" = 0
  |     "CFBundleIdentifierKernel" = "com.apple.driver.usb.AppleUSBHostCompositeDevice"
  |     "IOMatchedAtBoot" = Yes
  |     "IOMatchCategory" = "IODefaultMatchCategory"
  |     "IOPrimaryDriverTerminateOptions" = Yes
  |     "bDeviceClass" = 0
  |   }
  |   
  +-o lghub_agent  <class AppleUSBHostDeviceUserClient, id 0x100002983, !registered, !matched, active, busy 0, retain 7>
  |   {
  |     "IOUserClientCreator" = "pid 1438, lghub_agent"
  |     "IOUserClientDefaultLocking" = Yes
  |   }
  |   
  +-o IOUSBHostInterface@0  <class IOUSBHostInterface, id 0x100002986, registered, matched, active, busy 0 (5 ms), retain 9>
  | | {
  | |   "USBPortType" = 0
  | |   "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBHostFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
  | |   "USB Vendor Name" = "Motorola Solutions, Inc."
  | |   "bcdDevice" = 9238
  | |   "USBSpeed" = 3
  | |   "idProduct" = 36886
  | |   "IOServiceDEXTEntitlements" = (("com.apple.developer.driverkit.transport.usb"))
  | |   "bInterfaceSubClass" = 0
  | |   "bConfigurationValue" = 1
  | |   "locationID" = 34734080
  | |   "USB Product Name" = "TETRA PEI interface"
  | |   "bInterfaceProtocol" = 0
  | |   "iInterface" = 0
  | |   "bAlternateSetting" = 0
  | |   "idVendor" = 3245
  | |   "bInterfaceNumber" = 0
  | |   "bInterfaceClass" = 255
  | |   "bNumEndpoints" = 2
  | | }
  | | 
  | +-o lghub_agent  <class AppleUSBHostInterfaceUserClient, id 0x100002988, !registered, !matched, active, busy 0, retain 6>
  |     {
  |       "UsbUserClientBufferStatistics" = {"IOMemoryDescriptor"=0,"IOBufferMemoryDescriptor"=0,"IOSubMemoryDescriptor"=0}
  |       "IOUserClientCreator" = "pid 1438, lghub_agent"
  |       "UsbUserClientBufferAllocations" = {"Bytes"=0,"Descriptors"=0}
  |       "IOUserClientDefaultLocking" = Yes
  |     }
  |     
  +-o IOUSBHostInterface@1  <class IOUSBHostInterface, id 0x100002987, registered, matched, active, busy 0 (5 ms), retain 9>
    | {
    |   "USBPortType" = 0
    |   "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBHostFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
    |   "USB Vendor Name" = "Motorola Solutions, Inc."
    |   "bcdDevice" = 9238
    |   "USBSpeed" = 3
    |   "idProduct" = 36886
    |   "IOServiceDEXTEntitlements" = (("com.apple.developer.driverkit.transport.usb"))
    |   "bInterfaceSubClass" = 0
    |   "bConfigurationValue" = 1
    |   "locationID" = 34734080
    |   "USB Product Name" = "TETRA PEI interface"
    |   "bInterfaceProtocol" = 0
    |   "iInterface" = 0
    |   "bAlternateSetting" = 0
    |   "idVendor" = 3245
    |   "bInterfaceNumber" = 1
    |   "bInterfaceClass" = 255
    |   "bNumEndpoints" = 2
    | }
    | 
    +-o lghub_agent  <class AppleUSBHostInterfaceUserClient, id 0x10000298a, !registered, !matched, active, busy 0, retain 6>
        {
          "UsbUserClientBufferStatistics" = {"IOMemoryDescriptor"=0,"IOBufferMemoryDescriptor"=0,"IOSubMemoryDescriptor"=0}
          "IOUserClientCreator" = "pid 1438, lghub_agent"
          "UsbUserClientBufferAllocations" = {"Bytes"=0,"Descriptors"=0}
          "IOUserClientDefaultLocking" = Yes
        }

more details in my comment.

I have these entitlements granted by apple so no SIP deactivation needed:

	<key>com.apple.developer.driverkit</key><true/>
	<key>com.apple.developer.driverkit.family.serial</key<true/>
	<key>com.apple.developer.driverkit.transport.usb</key>
	<array>
		<dict>
			<key>idVendor</key>
			<integer>3245</integer>
		</dict>
	</array>
	<key>com.apple.security.app-sandbox</key>
	<true/>
<key>IOTTYSuffix</key>
			<string>0</string>
			<key>bConfigurationValue</key>
			<integer>1</integer>
			<key>CFBundleIdentifierKernel</key>
			<string>com.apple.kpi.iokit</string>
			<key>IOTTYBaseName</key>
			<string>tetra-pei</string>
			<key>IOClass</key>
			<string>IOUserService</string>
			<key>CFBundleIdentifier</key>
			<string>dev.paulober.MotorolaTetraPeiDriver</string>
			<key>IOMatchCategory</key>
			<string>dev.paulober.MotorolaTetraPeiDriver</string>
			<key>IOProviderClass</key>
			<string>IOUSBHostInterface</string>
			<key>IOResourceMatch</key>
			<string>IOKit</string>
			<key>IOUserClass</key>
			<string>MotorolaTetraPeiDriver</string>
			<key>IOUserServerName</key>
			<string>dev.paulober.MotorolaTetraPeiDriver</string>
			<key>bInterfaceNumber</key>
			<integer>0</integer>
			<key>IOParentMatch</key>
			<dict>
				<key>IOProviderClass</key>
				<string>IOUSBHostDevice</string>
				<key>idVendor</key>
				<integer>3245</integer>
				<key>idProduct</key>
				<integer>36886</integer>
			</dict>
			<key>bInterfaceClass</key>
			<integer>255</integer>
			<key>bInterfaceSubClass</key>
			<integer>0</integer>
			<key>bInterfaceProtocol</key>
			<integer>0</integer>
			<key>IOProbeScore</key>
			<integer>60000</integer>

My iig looks like this in the beginning:

#include <Availability.h>
#include <DriverKit/IOService.iig>
#include <USBSerialDriverKit/IOUserUSBSerial.iig>

class MotorolaTetraPeiDriver: public IOUserUSBSerial

The plist you posted looks strange - it has a mixture of entitlements (which go into a .entitlements file) and other properties which I'd expect to see in an Info.plist. I don't see your driver's personality anywhere, which is what the OS uses for driver matching.

Take a look at /System/Library/DriverExtensions/com.apple.DriverKit-AppleUSBSerial.dext/Info.plist for example.

Found the solution it seems to be missing CFBundle... keys even though Xcode auto generated parts of it and then it thought its a no code dext. Next problem it has an included embedded provisioning profile but the console shows its missing the entitlement that is included in the embedded provisioning profile...

Ok so for some reason the provisioning profile includes the usb entitlement for vendorID="" and I thought because I requested for a specific vendor id that I only get that. So after putting <string></string> into the vendor id field in my usb entitlement in Xcode they now match and it works. Strange....

Should I set something else for IOClass if my driver does bind to usb interfaces and takes care about exposing them as usb serial devices to the os? I currently have IOClass=IOUserService.

Can't get USBSerialDriverKit driver loaded
 
 
Q