core-motion

Access iOS and watchOS motion, orientation, step, activity, and altitude signals.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill core-motion-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-motion
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/core-motion
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill core-motion-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CoreMotion helps you reliably access and interpret iOS/watchOS device motion and activity signals without manually stitching together raw accelerometer/gyro/compass data.

Core Features & Use Cases

  • Read fused motion & orientation: Use CMMotionManager to get CMDeviceMotion attitude (pitch/roll/yaw), user acceleration, heading, and rotation rate for responsive motion-based interactions.
  • Count steps & estimate movement: Use CMPedometer for step counts, distance, pace, cadence, and floor ascents in fitness and navigation contexts.
  • Detect user activity mode: Use CMMotionActivityManager to classify walking/running/stationary/automotive/cycling with confidence handling.
  • Track altitude: Use CMAltimeter for relative altitude (pressure-based) and absolute altitude (when available).
  • Practical production guidance: Covers Info.plist permissions, availability checks, choosing attitude reference frames, update interval tradeoffs, and common battery/performance pitfalls.

Quick Start

Start by adding NSMotionUsageDescription to your app’s Info.plist, then create a single CMMotionManager instance and begin the appropriate start*Updates call after checking sensor availability.

Frequently Asked Questions about core-motion

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

FAQPage Schema
How do I access iOS device motion and orientation data using CMMotionManager?

Access iOS device motion by creating a single CMMotionManager instance to read CMDeviceMotion attitude, user acceleration, heading, and rotation rate. Check hardware availability and authorization before starting updates for responsive motion-based interactions.

What's the best way to count steps and estimate distance in a fitness app?

Count steps and estimate movement by using the CMPedometer API to retrieve step counts, distance, pace, cadence, and floor ascents. This provides reliable fitness and navigation metrics without manually stitching together raw sensor data.

How does activity recognition classify walking versus driving on iOS?

Activity recognition classifies movement using CMMotionActivityManager to detect walking, running, stationary, automotive, and cycling states. It handles confidence levels to help apps distinguish between different user activity modes accurately.

Do I need Info.plist permission keys to track barometric altitude with CMAltimeter?

Yes, tracking barometric altitude requires adding NSMotionUsageDescription to your app's Info.plist. CMAltimeter provides relative pressure-based altitude and absolute altitude readings, but you must perform authorization checks before starting updates.

Why does CoreMotion drain battery and how do I tune update intervals?

CoreMotion drains battery when update intervals are too frequent. Tune update intervals by balancing responsiveness with power consumption, choosing appropriate attitude reference frames, and following start/stop update lifecycle guidance to avoid common performance pitfalls.