sensorkit

Collect ambient, motion, usage, and biometric sensor data on iOS and watchOS via SensorKit.

Updated May 6, 2026
One-click install
npx skills add https://github.com/Roy-wonji/claude-config --skill sensorkit-roy-wonji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sensorkit
Source: https://github.com/Roy-wonji/claude-config/tree/main/skills/swift-ios-skills/skills/sensorkit
Command: npx skills add https://github.com/Roy-wonji/claude-config --skill sensorkit-roy-wonji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SensorKit permissions, entitlements, and authorization steps are complex, so researchers waste time failing to access sensor data or collecting unusable results.

Core Features & Use Cases

  • Access authorization-ready sensor collection: Guide setup for the SensorKit reader entitlement and required Info.plist keys so users can approve research sensor access.
  • Record and fetch sensor readings: Provide a practical workflow for starting/stopping recording and fetching historical data via SRSensorReader, SRFetchRequest, and device selection.
  • Avoid common data-access failures: Cover the 24-hour data holding period, per-sensor usage details, delegate requirements, and SRError handling for reliable study pipelines.

Use case: Collect ambient light, keyboard metrics, and device usage reports for a sleep study, then fetch data from devices after the holding window to build a research dataset.

Quick Start

Ask for a SensorKit setup plan for ambient light and keyboard metrics, including the exact entitlement values, Info.plist keys, and a Swift SRSensorReader authorization + recording + fetch flow.

Frequently Asked Questions about sensorkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I request SensorKit authorization for multiple sensors in an iOS research app?

SensorKit authorization for multiple sensors requires configuring the com.apple.developer.sensorkit.reader.allow entitlement, adding NSSensorKitUsageDescription keys, and calling SRSensorReader to request per-sensor user authorization. Apple-approved research study eligibility is required before requesting access.

Why does my SensorKit fetch request return no data or an SRError?

Your SensorKit fetch request likely returns no data or an SRError because of the mandatory 24-hour data holding period. Historical sensor samples are only accessible after this holding window passes, and SRError cases must be handled in your delegate callbacks to ensure reliable data pipelines.

What Info.plist keys and entitlements do I need to set up SensorKit for iOS?

Setting up SensorKit for iOS requires the com.apple.developer.sensorkit.reader.allow entitlement, along with NSSensorKitUsageDescription, PrivacyPolicyURL, and UsageDetail keys in your Info.plist. These configurations are mandatory for Apple-approved research study eligibility and user authorization.

How do I fetch historical sensor data by time range and device using SRFetchRequest?

To fetch historical sensor data by time range and device, you create an SRFetchRequest specifying the desired time window and target device, then execute it via SRSensorReader. Results are delivered through per-sensor delegate callbacks after the 24-hour data holding period.

Can I use SensorKit to collect keyboard metrics and ambient light for a sleep study?

Yes, you can use SensorKit to collect keyboard metrics, ambient light, and device usage reports for a sleep study. It supports starting and stopping recording for these sensors and fetching historical samples to build a research dataset after the holding window.

Do I need Apple-approved research study eligibility to access watchOS biometric sensor data?

Yes, accessing watchOS biometric sensor data through SensorKit requires Apple-approved research study eligibility. You must obtain the SensorKit reader entitlement and handle per-sensor delegate callbacks to collect ambient, motion, usage, and biometric data legally.