Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Can't enable an iOS Driverkit driver when using an older app ID

Hi there,

We've discovered a problem with our iOS app. We've been attempting to add a Driverkit driver to it, but any time we run the app through Testflight, the driver installs fine, but when we go to enable the driver toggle in the app's settings, the toggle stays on, but in the device logs I can see:

could not insert bundle at <private> into manager: <private>

As you would expect - this means the driver is not actually enabled and does not respond to a device being connected to the iPad.

This does not happen when building & running the app locally, nor does it happen when installing an Ad Hoc build.

We also have a different app, not yet shipped. We are able to add the driver to that app without issue. It works after going through Testflight.

What we have discovered now is that everything works fine even if we just create an entirely new app with it's own bundle IDs. I should point out that in all cases, we're keeping the capabilities the same for each of these apps/IDs - including the managed capabilities.

The bundle IDs that have this problem are older (5 years old or more). It seems like any newer ID will work, but trying to add the driver (and the associated managed capabilities) to an older app/ID results in this vague error message, with no further details.

If we inspect the resulting dexts, we can also see that the "Internal requirements code size" is different on the ones that fail. The failing ones have a size of 204 bytes, whereas the working ones all have a size of 220 bytes. Not sure if that's related but it's strikingly consistent.

Does this mean there is an issue with older app IDs, and we need Apple to manually refresh them in some way before the driverkit capabilities will work after going through Testflight? We have two apps in this state, both are of the same vintage (~5 years+).

We've been battling this issue for months on and off, so would appreciate some help.

Answered by DTS Engineer in 835072022

This same error message came up while I was investigating a different issue and one specific thing that you should check is what the build number in Xcode is and, more specifically, make sure that it's 4 characters or less (r.149205067). Xcode uses "CFBundleVersion" to store the build number which, per our document, is officially defined as:

"This key is a machine-readable string composed of one to three period-separated integers, such as 10.14.1. The string can only contain numeric characters (0-9) and periods."

However, KEXTs/DEXTs are obviously critical vectors for attacking the system and because of that they're subject to a much more detailed scrutiny than other components. Critically, much of that validation was written a long time ago and hasn't really changed even though development practices have.

The KEXT enforcement format for versions is both more rigid AND more flexible than the definition above. You can actually see that implementation here:

What it actually enforces is a format like this:

<1-4>.<1-4>.<1-4><1><0-3> -> "1.3.4b12"

(the <1> value is allowed to be a space or the letters <d, a, b, f>)

...which means any build number > 9999 fails because that's more than 4 characters in the first field

FYI, if you look around for what the max length of CFBundleVersion is, you'll find that people have (experimentally) found it to be "18" characters. The format above is where that limit actually comes from.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

but when we go to enable the driver toggle in the app's settings, the toggle stays on, but in the device logs I can see:

Can you post the full entry for that log message, particularly the source daemon/library/etc?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Accepted Answer

This same error message came up while I was investigating a different issue and one specific thing that you should check is what the build number in Xcode is and, more specifically, make sure that it's 4 characters or less (r.149205067). Xcode uses "CFBundleVersion" to store the build number which, per our document, is officially defined as:

"This key is a machine-readable string composed of one to three period-separated integers, such as 10.14.1. The string can only contain numeric characters (0-9) and periods."

However, KEXTs/DEXTs are obviously critical vectors for attacking the system and because of that they're subject to a much more detailed scrutiny than other components. Critically, much of that validation was written a long time ago and hasn't really changed even though development practices have.

The KEXT enforcement format for versions is both more rigid AND more flexible than the definition above. You can actually see that implementation here:

What it actually enforces is a format like this:

<1-4>.<1-4>.<1-4><1><0-3> -> "1.3.4b12"

(the <1> value is allowed to be a space or the letters <d, a, b, f>)

...which means any build number > 9999 fails because that's more than 4 characters in the first field

FYI, if you look around for what the max length of CFBundleVersion is, you'll find that people have (experimentally) found it to be "18" characters. The format above is where that limit actually comes from.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thanks Kevin. In this case, the problem was indeed that our build number was set to a value greater than 9999.

Our build number was so high because it was matched to the build number we use on the Android version of the app. This was to help our QA dept (and others) identify which versions of the app were the same between platforms.

Given the limitations described above we have adopted a workaround for the build number on iOS, which I will explain here in case another lost developer hits this issue and is looking for a workaround themselves.

If the build number is 12345 on Android, then on iOS we just break the number up into the format 0.1.2345. This keeps within the iOS pattern limitations without losing the visual connection between the iOS and Android versions for human eyes (people testing the app).

It's not ideal, but Android demands a build number that increments, so we can't solve it on the Android side. This approach seems to work well enough for our particular circumstances.

Thanks again for all the help!

Can't enable an iOS Driverkit driver when using an older app ID
 
 
Q