Search code examples
watchkitapple-watchwatchos-2

Watch OS - is it possible to gather data from all the sensors?


I need to build a Watch OS application that gathers and sends the data collected from all the sensors of a series 2 watch:

  • Accelerometer
  • Gyroscope
  • GPS / GLONASS
  • Light sensor
  • Heart rate

Is it possible to collect this data programmatically?


Solution

  • There is no single framework to do this, but you can access each sensor using the following framework:

    • Accelerometer and Gyroscope - CMMotionManager, available watchOS2+
    • GPS - CoreLocation, available watchOS2+
    • Heart Rate - HealthKit, available watchOS2+, for accessing continuous measurements, use HKWorkout
    • Light Sensor - this is the only one that is not available even in watchOS3