HomeKit support on MacOS

I am currently developing an app for MacOS that needs to control HomeKit devices like lights. However, it seems like MacOS is supported on the official documentation, but not when I try to create an app ID on developer.apple.com.

On the link https://developer.apple.com/apple-home/, MacOS is clearly showed as supported for MacOS. But when I try to create an app ID, it shows that it is only compatible for iOS, VisionOS and WatchOS.

Could this be clarified?

Best regards, orangeidle25

Answered by DTS Engineer in 884226022

HomeKit is an outlier in that it’s supported on the Mac but only for Mac Catalyst apps.

Share and Enjoy

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

Accepted Answer

HomeKit is an outlier in that it’s supported on the Mac but only for Mac Catalyst apps.

Share and Enjoy

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

HomeKit is an outlier in that it’s supported on the Mac but only for Mac Catalyst apps.

FYI, while the sample project "Interacting with a home automation network" does not include a specific Mac Catalyst destination, the project can easily be updated to include it. You'll get one build error in its "tapAddAccessory" method, but that error is because Mac Catalyst does not include "addAndSetupAccessories". You can clear that error by simply deleting that code, after which the sample will build and run fine.

As a side note, this sample is VERY useful as a general development helper, particularly when run on the Mac. It shows you the full HomeKit layout and configuration of every accessory in the target home, which makes it easier to figure out how an accessory is configured and controlled. It also lets you see that "raw" configuration at the same time your app is interacting with it, which can help investigating and debugging any issues.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

I have tried to reach out to Apple to get some clarification on why HomeKit is not supported on MacOS, the "use Mac Catalyst" makes no sense, why not just support it natively??

I have tried to reach out to Apple to get some clarification on why HomeKit is not supported on macOS. The "use Mac Catalyst" makes no sense. Why not just support it natively?

The main technical issue is that part of HomeKit (specifically, camera APIs like HMCameraView) are built on UIView, which prevents the framework from being "directly" exported as a macOS framework. This could be addressed by either removing those APIs from the macOS framework or by creating macOS equivalents of the same API, but that's never been done.

In practice, I think the experience has been that most 3rd-party HomeKit apps also run on iOS (or, more typically, started as macOS apps), which has made Mac Catalyst the natural development platform.

That leads to my question: what are you trying to do that can't be done through Mac Catalyst?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

I am working on a more customizable home hub that can have a more granular control over accessories and actions. some of this comes from my own personal need as I have moved away from a Pi smart home to using a Mac to monitor and control and monitor Matter accessories and legacy 1-wire environment. As I work with accessories I do see how there may be more opportunities for a Mac based Home Hub, I think you are working on a stand alone one.

I'm looking into the request side, however, I have question here:

Our initiator has no PCI or Thunderbolt bus and no DMA path, so SCSIControllerDriverKit does not fit. This is confirmed by DTS in thread 776020, where Kevin Elliott explains that SCSIControllerDriverKit passes data through fBufferIOVMAddr as a physical address with no mechanism to convert it into a VM address the dext can access. He also notes it cannot be used with any bus other than PCI or Thunderbolt. Block Storage Device is therefore the family we need.

You said you've gotten this working, so my question is basically "how"? DoAsyncReadWrite() provides a raw bus address, which creates exactly the same problem as SCSIControllerDriverKit. How are you processing I/O requests?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

HomeKit support on MacOS
 
 
Q