A lightweight Swift package for accessing low-level system sensor and device metrics, including CPU, memory, thermal state, battery, and hardware performance statistics.
Built for developers who need deeper visibility into Apple device performance beyond standard public APIs.
- 🌡 Thermal State Monitoring (device & CPU pressure indicators)
- 🧠 CPU Usage Tracking (real-time system load)
- 💾 Memory Analytics (used, free, and active memory)
- 💽 Disk Usage Stats (storage capacity and availability)
- 🔋 Battery Information (level, state, and health signals)
- ⚡ Power & Performance Metrics
- 📊 Formatted System Reports (human-readable output)
Apple provides limited system-level metrics through public APIs. This library helps bridge that gap by offering:
- Deep system performance insights
- Lightweight diagnostic tools for developers
- Easy integration into monitoring dashboards & utilities
- A clean, Swift-native API design
- Language: Swift
- Frameworks: IOKit / Darwin APIs
- Platform: iOS / macOS
- Architecture: Modular service-based design
- Package Manager: Swift Package Manager (SPM)
Add this repository to your Package.swift:
dependencies: [
.package(url: "https://github.com/shubham230523/AppleCoreSensorKit.git", from: "1.0.0")
]Or in Xcode:
File → Add Packages → Paste repo URL
import AppleCoreSensorKit
let sensorKit = AppleCoreSensorKit.shared
// 🌡 Thermal State
let thermalState = await sensorKit.getThermalState()
// 🧠 CPU Usage
let cpuUsage = await sensorKit.getCPUUsage()
// 💾 Memory Usage
let memory = await sensorKit.getMemoryStats()
// 💽 Disk Usage
let disk = await sensorKit.getDiskUsage()
// 🔋 Battery Info
let battery = await sensorKit.getBatteryInfo()
print("CPU:", cpuUsage)
print("Memory:", memory)
print("Disk:", disk)AppleCoreSensorKit/
├── Sources/
│ ├── Core/ # Core sensor engine
│ ├── CPU/ # CPU metrics
│ ├── Memory/ # Memory stats
│ ├── Disk/ # Disk usage
│ ├── Battery/ # Battery info
│ ├── Thermal/ # Thermal monitoring
│ └── Utils/ # Helpers & formatters
├── Tests/
└── Package.swift
-
Some metrics rely on low-level system APIs
-
Behavior may vary across iOS/macOS versions
-
Not intended for App Store-sensitive use cases if private APIs are used internally
-
Best suited for:
- Developer tools
- System diagnostics apps
- Performance monitoring dashboards
- 📊 System monitoring dashboards
- 🧪 Performance testing tools
- 🔍 Debugging & profiling apps
- ⚙️ Developer utilities
- 📱 Device health tracking tools
Contributions are welcome!
You can help by:
- Adding new sensor modules
- Improving accuracy of metrics
- Optimizing performance
- Enhancing documentation
MIT License © 2026
If you find this project useful, please consider giving it a ⭐ on GitHub!