Mac maintenance
How to Use system_profiler on Mac for Diagnostics
Use system_profiler from the Terminal to get detailed Mac hardware and software info — for diagnostics, scripts, and exporting machine reports.
The “About This Mac” window is fine for showing off your Mac to a friend, but it doesn’t tell you what kernel extensions are loaded, what your battery’s serial number is, or whether your USB hub negotiated USB 3 or fell back to USB 2. The Terminal command behind that whole thing — and a lot more — is system_profiler.
It’s slow. It’s verbose. The output formats can be confusing. But it’s the most authoritative source of “what’s actually in this Mac” and “what does macOS think is happening with the hardware right now.”
The 30-second tour
system_profiler
With no arguments, it dumps everything. On a recent MacBook Pro this is 3,000+ lines and takes 10–30 seconds. You almost never want this directly.
Better: list the available “data types” first.
system_profiler -listDataTypes
That gives you names like SPHardwareDataType, SPMemoryDataType, SPSoftwareDataType, SPDisplaysDataType. There are about 40 of them. Each one is a focused report.
To run just one:
system_profiler SPHardwareDataType
That’s the one most equivalent to “About This Mac” — model name, model identifier, chip, total memory, serial number, hardware UUID.
The data types that matter
Every Mac admin or power user ends up using a subset:
SPHardwareDataType— CPU/SoC, RAM total, model identifier, serial.SPSoftwareDataType— OS version, build, computer name, uptime.SPDisplaysDataType— every display attached, with resolution, refresh rate, and the chipset driving it (M-series GPU, Intel HD/Iris, AMD).SPMemoryDataType— RAM slots and per-stick info (Intel only — Apple Silicon’s unified memory shows the total here).SPStorageDataType— every mounted volume, with type, size, free space, and whether encrypted.SPNVMeDataType,SPSerialATADataType— the actual SSDs/HDDs.SPUSBDataType— every USB device, including hubs and the speed they negotiated.SPThunderboltDataType— TB devices and their port assignments.SPBluetoothDataType— paired devices, current connections.SPAirPortDataType— Wi-Fi info, current SSID, RSSI, channel.SPNetworkDataType— every network interface and its config.SPPowerDataType— battery details, AC adapter info, power source history.SPPrintersDataType— installed printers and queues.SPApplicationsDataType— every.appmacOS knows about.SPInstallHistoryDataType— every package and update ever installed.
Run any of these the same way:
system_profiler SPPowerDataType
system_profiler > ~/Desktop/full-report.txt and grep against the file.Output formats
Default output is human-readable text. For scripts, switch to XML or JSON:
system_profiler -xml SPHardwareDataType
system_profiler -json SPHardwareDataType
The JSON output (added a few macOS versions back) is the easiest to parse with jq:
system_profiler -json SPHardwareDataType | \
jq '.SPHardwareDataType[0].machine_model'
Returns just the model name as a JSON string.
A useful one-liner for serial number:
system_profiler -json SPHardwareDataType | \
jq -r '.SPHardwareDataType[0].serial_number'
jq -r strips the surrounding quotes so you can pipe the value into another command.
Detail levels
system_profiler -detailLevel mini SPHardwareDataType
system_profiler -detailLevel basic SPHardwareDataType
system_profiler -detailLevel full SPHardwareDataType
mini skips personal info (serial numbers, hardware UUID). basic is the default for many data types. full includes everything.
If you’re sharing a report with support and don’t want to leak your serial:
system_profiler -detailLevel mini > ~/Desktop/report.txt
Battery and AC adapter inspection
system_profiler SPPowerDataType
You get sections for Battery Information, AC Charger Information, and historical settings. The fields worth knowing:
Cycle Count— how many full charge/discharge cycles the battery has been through.Condition— Apple’s overall verdict (“Normal” or worse).Maximum Capacity— current capacity as a percentage of design capacity.Charger Wattage— what wattage your current charger reports. If you bought a 96W charger and this says 60W, your cable is the bottleneck.Charger Family Code— the protocol family. USB-C PD vs MagSafe.
To get just the cycle count:
system_profiler -json SPPowerDataType | \
jq '.SPPowerDataType[] | select(.sppower_battery_health_info) | .sppower_battery_health_info.sppower_battery_health_cycle_count'
It’s clunky but it works. Useful for tracking how many cycles your battery’s added each month.
Storage and encryption status
system_profiler SPStorageDataType
For each volume you’ll see:
FreeandCapacity(in bytes)File System(APFS,HFS+,exFAT,NTFS)Encrypted—YesorNo. If your Mac says yes, FileVault is on for that volume.Bootable— whether macOS considers this a startup disk.
For physical-disk info:
system_profiler SPNVMeDataType
That tells you the SSD’s model number, capacity, link speed, and PCIe lane count. If your fancy NVMe enclosure is showing as a single PCIe lane, this is where you’d see it.
USB and Thunderbolt diagnostics
USB:
system_profiler SPUSBDataType
Every USB controller is listed, and under each, the devices currently attached. The big diagnostic value is the Speed field — Up to 5 Gb/sec (USB 3.0), Up to 480 Mb/sec (USB 2.0), Up to 10 Gb/sec (USB 3.1 Gen 2).
If your external SSD is showing 480 Mb/sec, it negotiated USB 2 — usually because of the cable. This is exactly the kind of thing you’d never spot in System Settings.
Thunderbolt:
system_profiler SPThunderboltDataType
You’ll see each TB port and what’s connected. On a Mac with two TB controllers, this also tells you which port is on which controller — useful when you’re trying to balance bandwidth between two TB displays.
Wi-Fi diagnostics
system_profiler SPAirPortDataType
That dumps every Wi-Fi network you’ve ever joined (preferred networks list), the current connection’s RSSI, channel, security mode, and country code. It’s verbose; to just see your current connection:
system_profiler SPAirPortDataType | grep -A 20 "Current Network"
If you’re trying to figure out why your Wi-Fi is slow, the Channel field is interesting — if you’re sharing a 20 MHz channel in 2.4 GHz with five neighbors, you’ll see it here.
Software inventory
system_profiler SPApplicationsDataType
Every .app macOS has cataloged. This includes apps in /Applications, ~/Applications, system frameworks’ helper apps, and a lot of stuff you forgot you installed. Each entry has a path, version, and (for code-signed apps) signing info.
To find every app from a specific developer:
system_profiler SPApplicationsDataType | grep -B2 -A2 "Adobe"
Install history
system_profiler SPInstallHistoryDataType
Every macOS update, every .pkg you’ve ever installed, with timestamps. This goes back years. If you can’t remember whether you ever installed a particular driver, this’ll tell you.
The list lives in /Library/Receipts/InstallHistory.plist — system_profiler is just a friendlier reader for it.
Saving a full report
For when AppleCare asks for one:
system_profiler -xml > ~/Desktop/full-system-report.spx
The .spx extension makes it open directly in System Information. (If you double-click it, the System Information app opens it as if it were a saved profile.)
For something more readable:
system_profiler -detailLevel full > ~/Desktop/full-report.txt
The text version is what most support folks actually want.
Building diagnostic scripts
A status one-liner for a fleet management script:
system_profiler -json SPSoftwareDataType SPHardwareDataType | \
jq '{
os: .SPSoftwareDataType[0].os_version,
serial: .SPHardwareDataType[0].serial_number,
model: .SPHardwareDataType[0].machine_model,
chip: .SPHardwareDataType[0].chip_type,
ram: .SPHardwareDataType[0].physical_memory
}'
Returns a tidy JSON record:
{
"os": "macOS 14.4 (23E214)",
"serial": "X1XXXXXXXX",
"model": "MacBook Pro",
"chip": "Apple M3 Pro",
"ram": "36 GB"
}
Easy to ship to a database or log aggregator.
Performance notes
system_profiler is slow because it queries every subsystem the data type touches. Some calls hit the I/O Kit (which has to enumerate hardware) and some hit launchd (which has to enumerate services). Limiting to specific data types is the most important speed-up:
SPHardwareDataTyperuns in under a second.SPApplicationsDataTypecan take 20+ seconds on a Mac with thousands of installed apps.SPInstallHistoryDataTypeis fast.- The full report (no data type) is the slowest, since it runs everything sequentially.
If you need information often (say, in a script that runs every minute), cache the output. The data doesn’t change second to second.
Apple Silicon and Intel notes
Most data types behave the same. Notable differences:
SPMemoryDataTypeon Apple Silicon shows a single “Memory” entry with the total; there are no slots. On Intel Macs you see DIMMs.SPHardwareDataTypeshowschip_typeon Apple Silicon (e.g. “Apple M3 Pro”) andcpu_type/current_processor_speedon Intel.SPDisplaysDataTypelists “Apple M3 Pro” as the GPU on Apple Silicon; Intel iGPU and dGPU show separately.SPThunderboltDataTypeexists on both, but the port count and speeds differ; M-series Macs use TB4/USB4.
Apple deprecates fields between versions sometimes — if a script that worked on Big Sur is missing a key on Sequoia, check -json output to see what the current key is named.
When System Information app is faster
If you’re inspecting one Mac interactively, Cmd+Space → System Information is friendlier — you get a sidebar, a search box, and the same data formatted with proper headings. system_profiler wins when:
- You’re scripting (need machine-readable output)
- You’re SSH’d into a Mac headlessly
- You want to grep for a specific value across the full report
- You need to redirect a report to a file for support
Useful aliases
alias mac-info='system_profiler SPHardwareDataType SPSoftwareDataType'
alias mac-battery='system_profiler SPPowerDataType'
alias mac-disks='system_profiler SPStorageDataType'
alias mac-usb='system_profiler SPUSBDataType'
alias mac-wifi='system_profiler SPAirPortDataType'
Drop those in your ~/.zshrc and the long command becomes a quick one. system_profiler’s real value is having every fact about your Mac one query away — once you know the data type names, the rest is muscle memory.