My app collects CMPedometerData both on the iPhone and the Watch.
iPhone\'s steps number (both in real time and historical data) are significantly l
HealthKit uses HKStatisticsQuery
and HKStatisticsCollectionQuery
to compute the aggregated step count from several devices. These methods automatically detect overlaps in the measurements and get rid of the duplicate entries.
You can find some sample in in the official documentation of HKStatisticsQuery.