When troubleshooting a malfunctioning USB-C dock, verifying the mathematical power draw of an external display, or debugging custom kernel extensions (kexts) on macOS, the graphical \”System Information\” app often lacks the raw, low-level data required by engineers. To mathematically interrogate the live hardware tree and extract precise hexadecimal device telemetry directly from the kernel, macOS developers use the ioreg command.
Why Use the ioreg Command?
The ioreg command acts as a direct mathematical window into the macOS I/O Kit Registry. The I/O Kit is the object-oriented framework that the macOS kernel (XNU) uses to manage hardware drivers. Every single piece of hardware physically connected to your Mac—from the internal Bluetooth radio to an external Thunderbolt drive—is mathematically instantiated as a node in a massive, hierarchical tree. The ioreg command allows you to traverse this mathematical tree in the terminal, dumping the raw properties, states, and power metrics of any device in real-time.
Step 1: Dump the Entire I/O Registry Tree
Because the registry contains thousands of nodes, dumping the entire tree at once is usually only done when piping the output to a text file for deep analysis.
- Open the macOS Terminal.
- Execute the base command:
ioreg
- Press Enter. The terminal will flood with a massive mathematical hierarchy showing exactly how the kernel maps hardware classes (like
IOPCIDeviceandAppleACPIPlatformExpert) to physical components.
Step 2: Filter for Specific Hardware Classes
To make the data readable, you must use mathematical flags to filter the output for specific hardware components.
- Use the
-c(class) flag to isolate a specific type of device. For example, to view all USB devices, query theIOUSBclass:
ioreg -c IOUSB
- To view battery telemetry (which is critical for diagnosing degraded MacBook batteries), query the
AppleSmartBatteryclass:
ioreg -c AppleSmartBattery
This command mathematically outputs raw battery properties, including MaxCapacity, CurrentCapacity, and CycleCount, bypassing the heavily abstracted macOS graphical interface.
Step 3: Extract Verbose Device Properties
If you are developing a driver and need to see the exact mathematical hex values and configurations applied to a device, you must use the verbose flag.
- Combine the
-l(list properties) flag with your class search:
ioreg -l -c IOGraphicsAccelerator2
This mathematically forces the kernel to dump the internal property dictionaries (often formatted as raw XML/plist data) for your GPU, detailing exact VRAM allocations, current clock states, and driver bundle IDs.
By mastering the ioreg command, macOS systems engineers can mathematically bypass the GUI and extract real-time, low-level telemetry directly from the kernel’s hardware registry.