HomeKit works on xCode iPhone, but not Testflight

First time poster and new developer...


I'm working on a simple app to see the status of HomeKit devices, additionally it will be able to change the state of many of those devices.


It will not have the capability to create new homes, rooms, accessories.


I have 10 HK devices in my home and can control them from the built it Home App on my personal iPhone 11.

Additionally, I have 12 HK devices created to a second home from the Simulator. The name of that home is Simulator. I can access them also from the Home app.


From my iPhone 11 I can access both the real home and the simulator home.


When I test in xCode to my iPhone 11, I can access both my real home and the simulator home. It reads both homes from the one app. I can control both real and simulated devices from my app. I was rather pleased with the outcome. I cannot access or control any HK device from a iOS Simulated iPhone device. My iPhone reads and controls all devices as expected when connected to mac & xCode via USB & wireless. My iPhone reads and controls devices as expected even when not running from Xcode.


But then...

I submit to App Store Connect and run via Test Flight and now FAIL.


My app does not see any "homes" from homeManagerDidUpdateHomes Delegate



//Accessing HMHomeManager.homes = 2 devices

// to delegate = 2 homes from delegate didInitializeHomeManager


//Auth Status raw data = 5

// read homes.accessories

// read services

// read the values from the services

// readValue of various devices including Brightness

// writeValue Brightness

// switch On / Off

Accepted Reply

Issue Resolved. When I added Homekit to the Signing and Capabilities Tab, I must have had Debug selected instead of Release or All. I beieve this stopped the Home Kit functionality from running as expected when not in debug.


I added HomeKit in Release and now everything is working as expected.

Replies

As I read this, it's a bit misleading at the end.


Using HMHomeManager.homes it returns two homes when I access from xcode. When running from the testflight version it returns ZERO homes. My Auth Status is always a 5.

Issue Resolved. When I added Homekit to the Signing and Capabilities Tab, I must have had Debug selected instead of Release or All. I beieve this stopped the Home Kit functionality from running as expected when not in debug.


I added HomeKit in Release and now everything is working as expected.