Hi Kevin,
Thanks for getting back to me on this one. I've been trying to do as you advised, but I'm hitting an error which gives the impression it's coming from the SystemExtensions API, but I could just be misunderstanding what it's trying to tell me.
I am attempting to run this code after importing the SystemExtensions framework (I've removed protections here):
guard let bundleID = Bundle.main.bundleIdentifier else {
print("Bundle identifier is nil")
return NSNumber(value: false)
}
let workspace = OSSystemExtensionsWorkspace.shared
let extensions = try workspace.systemExtensions(forApplicationWithBundleID: bundleID)
print("Extensions: \(extensions)")
return NSNumber(value: true)
but I hit this error:
Exception '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' was thrown while invoking isDriverKitSupported on target CheckDriverKitCapabilities with params (
)
callstack: (
0 CoreFoundation 0x0000000184e4c0cc 7BB5DC02-A4C7-3E6C-9C46-E79FF100E027 + 1155276
1 libobjc.A.dylib 0x00000001822e9abc objc_exception_throw + 88
2 CoreFoundation 0x0000000184e3aa7c 7BB5DC02-A4C7-3E6C-9C46-E79FF100E027 + 1084028
3 CoreFoundation 0x0000000184d5cb40 7BB5DC02-A4C7-3E6C-9C46-E79FF100E027 + 174912
4 SystemExtensions 0x00000002464ed254 7E1C5B8B-3068-3126-A895-BFCA62BE8124 + 4692
5 Test App 0x00000001057f61b8 $s10Test_App28CheckDriverKitCapabilitiesSwiftC08isDriverD9SupportedSo8NSNumberCyFTf4d_n + 668
6 Test App 0x00000001057f5e58 $s10Test_App28CheckDriverKitCapabilitiesSwiftC08isDriverD9SupportedSo8NSNumberCyFTo + 12
7 Test App 0x00000001043841b8 -[CheckDriverKitCapabilities isDriverKitSupported] + 104
This is when running on an iPad Pro (12.9 inch) (6th generation) running iPadOS 18.6. I've added the com.apple.developer.system-extension.install entitlement to the app.
Am I trying to do this incorrectly?
I will of course file a ticket to request a proper API to check for DriverKit support, just trying to verify if this potential workaround works or not first.