Health & Fitness

RSS for tag

Explore the technical aspects of health and fitness features, including sensor data acquisition, health data processing, and integration with the HealthKit framework.

Health & Fitness Documentation

Posts under Health & Fitness subtopic

Post

Replies

Boosts

Views

Activity

Old HealthKit samples from WatchOS getting deleted and recreated years later
I have recently come across a couple of odd HealthKit step samples from WatchOS. They represent step data measured in 2022 by my Apple Watch, but they have a creation date ("Date Added to Health") within the past couple of days. These odd samples show a "View All Quantities" button at the bottom of the sample Details page in the Health app on iOS 26 (which I've never seen before); the button leads to a list of many small step quantities, almost as if some older, smaller samples were consolidated into these newer samples. Even weirder is that at least some of these samples seem to be getting re-created repeatedly. For example, I've seen the same sample with a "Date Added to Health" of 9/5/25, then 9/8/25, twice on 9/9/25, and twice on 9/10/25. These samples were originally created by WatchOS 9, and are not being deleted/recreated by any apps on my device. I have only observed it since I updated to the iOS 26 beta (and now the RC); my watch was still running iOS 18 the first time it happened, but it has also happened since my watch was updated to WatchOS 26 beta. I did some debug printing of the odd samples and the normal samples surrounding them for comparison. Here's a normal sample: Sample: 80AC5AC5-CBD7-4581-B275-0C2ACA35B7B4 6 count 80AC5AC5-CBD7-4581-B275-0C2ACA35B7B4, (9.0), "Watch6,1" (9.0) "Apple Watch" (2022-09-15 16:20:14 -0500 - 2022-09-15 16:20:16 -0500) Device: <<HKDevice: 0x10591eee0>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:Watch6,1, operatingSystemVersion:9.0> Source: <HKSource:0x110588690 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2022-09-15 21:20:16 +0000 Days between end and add: 0 And here's one of the odd samples: Sample: 4982487F-1189-4F16-AB00-61E37818A66D 676 count 4982487F-1189-4F16-AB00-61E37818A66D, (9.0), "iPhone12,1" (16.2) "Apple Watch" metadata: { HKMetadataKeySyncIdentifier = "6:38082859-D9C8-466A-8882-53443B2A2D94:684969619.25569:684970205.31182:119"; HKMetadataKeySyncVersion = 1; } (2022-09-15 16:20:19 -0500 - 2022-09-15 16:30:05 -0500) Device: <<HKDevice: 0x10591ce40>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:iPhone12,1, operatingSystemVersion:16.2> Source: <HKSource:0x110588640 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2025-09-08 21:11:12 +0000 Days between end and add: 1088 Here's that same odd sample a day later, apparently recreated: Sample: 9E8B12FC-048D-4ECD-BE5B-D387AADE5130 676 count 9E8B12FC-048D-4ECD-BE5B-D387AADE5130, (9.0), "iPhone12,1" (16.2) "Apple Watch" metadata: { HKMetadataKeySyncIdentifier = "6:38082859-D9C8-466A-8882-53443B2A2D94:684969619.25569:684970205.31182:119"; HKMetadataKeySyncVersion = 1; } (2022-09-15 16:20:19 -0500 - 2022-09-15 16:30:05 -0500) Device: <<HKDevice: 0x12f01c4e0>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:iPhone12,1, operatingSystemVersion:16.2> Source: <HKSource:0x12f0f8230 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2025-09-09 20:53:18 +0000 Days between end and add: 1089 It's worth pointing out some differences between the "normal" and "odd" samples (besides the "View All Quantities" button in the Health app). The recreated "odd" samples have a different Source Revision - the "productType" and "operatingSystemVersion" refer to my iPhone, not the Apple Watch device that actually captured the samples. The odd samples also have metadata keys that don't exist in the other samples - HKMetadataKeySyncIdentifier and HKMetadataKeySyncVersion. Questions I'm hoping someone can help with: What are these samples? Why/how do they have a "View All Quantities" button that shows sub-samples? Is this new to iOS 26? Why are some of the samples getting recreated multiple times?
2
0
84
5d
Sleep Score API access
New in iOS 26 and WatchOS 26 is a Sleep Score calculation for users based on Duration, Bedtime and Interruptions. Unfortunately I can't find any APIs for developers to tap into this metric. Yes, in theory it's all created off the same Sleep Analysis data already available with HealthKit but that makes it very hard to recreate in our apps. If the numbers don't match up exactly, users will understandably complain. Can anyone confirm that this is the case and I've not missed a Sleep Score API? I'll then file feedback. Hopefully this doesn't go the way of Heart Rate Zones where the Apple Watch iPhone app has generated them for years and provided no way for third party apps to access these values (yes many feedbacks provided previously).
0
0
46
1d