Use of Undocumented IOKit APIs

I'm writing some code, intended to be run on macOS (not IOS). My code could greatly benefit from using IOReport, which is an undocumented IOKit API for obtaining various metrics like energy consumption on an Apple processor. I don't plan to submit my program to the App Store, but I do plan on making the Git repo containing my code public.

My understanding is that using undocumented IOKit APIs is strictly forbidden for IOS or macOS applications intended to be made available on the App Store.

But what about programs not intended to be submitted to the App Store, like in my case?

I'm wondering if anybody knows what Apple's policy is regarding using undocumented APIs in such a way on macOS.

Answered by DTS Engineer in 826523022

It’s important to draw a distinction between the business and technical side of this.

On the business side, I’m an engineer, not a lawyer, and thus can’t comment as to what’s ‘allowed’.

On the technical side, I want to stress that there’s no such thing as an undocumented API (or private API). By definition an API is something that’s meant to be called by apps [1]. Things that aren’t APIs are implementation details. And when you use that term it’s easier to evaluate your choices.

If you ship a program that relies on implementation details to a wide range of users and then those implementation details change, that puts you in a serious pickle. Your users will be grumpy and you’ll have to rush to update your app. Worse yet, these implementation details might change in a way that makes it impossible for you to reimplement the features that are now broken.

OTOH, if you’re just playing around, or building a tool for your own use, that’s much less problematic.

Written by michahn01 in 775197021
I do plan on making the Git repo containing my code public.

If you do that, please make sure that your read me is clear about your use of implementation details. I regularly see folks not do that, and then other folks use their code, and then everyone complains to me when that code breaks )-:

Share and Enjoy

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

[1] Normally I resolve the term app for things that you double click in the Finder, but in this case I’m using it to mean any third-party code, because that matches the term application in application programming interface.

It’s important to draw a distinction between the business and technical side of this.

On the business side, I’m an engineer, not a lawyer, and thus can’t comment as to what’s ‘allowed’.

On the technical side, I want to stress that there’s no such thing as an undocumented API (or private API). By definition an API is something that’s meant to be called by apps [1]. Things that aren’t APIs are implementation details. And when you use that term it’s easier to evaluate your choices.

If you ship a program that relies on implementation details to a wide range of users and then those implementation details change, that puts you in a serious pickle. Your users will be grumpy and you’ll have to rush to update your app. Worse yet, these implementation details might change in a way that makes it impossible for you to reimplement the features that are now broken.

OTOH, if you’re just playing around, or building a tool for your own use, that’s much less problematic.

Written by michahn01 in 775197021
I do plan on making the Git repo containing my code public.

If you do that, please make sure that your read me is clear about your use of implementation details. I regularly see folks not do that, and then other folks use their code, and then everyone complains to me when that code breaks )-:

Share and Enjoy

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

[1] Normally I resolve the term app for things that you double click in the Finder, but in this case I’m using it to mean any third-party code, because that matches the term application in application programming interface.

Use of Undocumented IOKit APIs
 
 
Q