
Sensorkit
Access research-grade sensor data using SensorKit for approved studies.
Install
npx skills add dpearson2699/swift-ios-skills --skill sensorkit -g -a claude-code -y- Repository
- dpearson2699/swift-ios-skills1.3k
- Category
- Writing
- Updated
- 3mo ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Access research-grade sensor data using SensorKit for approved studies. Use when an app needs SensorKit entitlement setup, Research Sensor & Usage Data authorization, ambient light, recorded motion, device usage, keyboard metrics, visits, speech, face, wrist temperature, ECG, PPG, acoustic settings, or sleep-session data. Route ordinary motion to CoreMotion and health records/workouts to HealthKit.
SensorKit
Choose the exact SRSensor and verify its individual availability. Use
CoreMotion for ordinary motion/activity features and HealthKit for health
records and workouts.
Contents
- Overview and Requirements
- Entitlements
- Info.plist Configuration
- Authorization
- Available Sensors
- SRSensorReader
- Recording and Fetching Data
- SRDevice
- Common Mistakes
- Review Checklist
- References
Overview and Requirements
SensorKit enables research apps to record and fetch sensor data across iPhone and Apple Watch. The framework requires:
- Apple-approved research study -- submit a proposal at researchandcare.org.
- SensorKit entitlement -- Apple grants
com.apple.developer.sensorkit.reader.allowonly for approved studies. - Manual provisioning profile -- Xcode requires an explicit App ID with the SensorKit capability enabled.
- User authorization -- the system presents a Research Sensor & Usage Data sheet that users approve per-sensor.
- Delayed retrieval -- design fetch timing around the canonical Data Holding Period.
An app can access up to 7 days of prior recorded data for an active sensor.
Entitlements
Add the SensorKit reader entitlement to a .entitlements file. List only the
sensors Apple approved for the study. Common entitlement values include:
<key>com.apple.developer.sensorkit.reader.allow</key>
<array>
<string>ambient-light-sensor</string>
<string>motion-accelerometer</string>
<string>device-usage</string>
<string>keyboard-metrics</string>
</array>
