Mirroring Workouts Sample Code Doesn't Work With Simulators

I've realised with the sample code from the WWDC video below I'm getting the following error when trying to use the iPhone simulator and apple watch simulator paired.

Whenever i try to test out the sample project I'm getting the following error.

Failed to send data: Error Domain=com.apple.healthkit Code=300 "Remote device is unreachable" UserInfo={NSLocalizedDescription=Remote device is unreachable, NSUnderlyingError=0x600000c9c900 {Error Domain=RPErrorDomain Code=-6727 "kNotFoundErr ('rapport:rdid:PairedCompanion' not found)" UserInfo={cuErrorDesc=kNotFoundErr ('rapport:rdid:PairedCompanion' not found), cuErrorMsg='rapport:rdid:PairedCompanion' not found, NSLocalizedDescription=kNotFoundErr ('rapport:rdid:PairedCompanion' not found)}}}

Is it not possible to not test out the new WorkoutKit mirroring API's using the simulator?

Currently right now if you run the project you'll notice that you can start a workout session on the iPhone > Apple Watch but there is no way to control and mirror on both devices at the moment i.e You can't control the iPhone app on the Apple Watch and vice versa.

Also because of this the iPhone can't send data to the Apple Watch i.e. pause, end, water etc. I'm guessing this is meant to be possible since it seems a bit strange to only be able to test this out with actual devices.

WWDC Session

https://developer.apple.com/wwdc23/10023

Sample Code https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/building_a_multidevice_workout_app

Answered by DTS Engineer in 809373022

Yeah, as of today, workout mirroring is not supported in simulators. The sample kind of calls that out by mentioning the following in the Readme:

This sample code project needs to run on physical devices.

Thanks @edorphy for filing the feedback.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Since it was introduced last summer, it hasn't worked for me on the simulator like it does on real devices. I have defaulted to just developing with this capability on real devices.

June 2023

FB12328242 - Health / Simulator: New mirrored workout session sendData throwing 'host device not connected' for watchOS and iOS simulators

July 2024

FB14310200 - HealthKit / Simulator: workoutSessionMirroringStartHandler function is not invoked when mirroring Apple Watch simulator to iPhone simulator in Xcode 15

Yeah, as of today, workout mirroring is not supported in simulators. The sample kind of calls that out by mentioning the following in the Readme:

This sample code project needs to run on physical devices.

Thanks @edorphy for filing the feedback.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Mirroring Workouts Sample Code Doesn't Work With Simulators
 
 
Q