What are the requirements for CFBundleVersion?

I manage a system that automatically generates system extensions, and in order to ensure that every release's dext can be activated over top of any other release, I have it increment the dext's CFBundleVersion so that every release has a unique version number.

However I just hit an error where, once CFBundleVersion reached 10000, dext activation would fail with this error:

Property "CFBundleVersion" must be a valid kext version

Apparently the maximum value any one of the three digits can be for CFBundleVersion is 9999, at least for a dext. So if CFBundleVersion only uses one number as opposed to three, it can't go higher than 9999.

Note that I found this out from experimentation. No where in Apple's documentation have I found any mention of this restriction, including, most distressingly, in the docs for CFBundleVersion.

Since I'm programmatically assigning this value, now I need to know: Are there any other requirements or restrictions for CFBundleVersion?

I'm curious if there are any in the context of an app (be it on macOS, iOS, tvOS, and so on) or other types of extensions, as well as with a DriverKit extension.

Replies

Well that’s an obscure edge case. KEXTs have stricter version number requirements than apps and it seems that this has carried across DEXTs.

The rules for this are documented, albeit in an archived doc, namely Kernel Extension Programming Topics > Info.plist Properties for Kernel Extensions. You can also see the specifics in the Darwin source, here and here.

I’d appreciate you filing a bug against the CFBundleVersion docs requesting that they cover this edge case. Please post your bug number here, just for the record.

Share and Enjoy

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