macOS · Troubleshooting
Run a hardware test on your Mac
Use Apple Diagnostics, launched at startup, to test your Mac's hardware components including memory, logic board, and battery for underlying issues.
How to open Apple Diagnostics
- Shut down the Mac completely
- Turn it on and immediately hold the D key (or use Startup Options on Apple silicon)
- Follow on-screen prompts to select a language and connect to Wi-Fi if needed
- Review the results and reference codes when testing completes
What you should know
- Started by holding D at startup, or via Recovery Mode on Apple silicon Macs
- Tests memory, storage controller, battery, and other internal components
- Produces a reference code that support staff can use to identify issues
- Does not test third-party or external peripherals
Why it matters
Apple Diagnostics provides an authoritative, hardware-level test independent of macOS itself, which is valuable when software-level troubleshooting doesn't explain a persistent problem like random restarts or battery issues. Because it runs outside the normal operating system, it can catch failures that wouldn't necessarily surface through everyday use. The reference codes it produces streamline conversations with Apple Support or an Apple Store, pointing directly to the likely faulty component.
Best practices
- Disconnect unnecessary external peripherals before running Diagnostics
- Ensure the Mac has a stable internet connection, as recent versions may need it
- Note the reference code exactly if contacting Apple Support afterward
- Run Diagnostics when experiencing unexplained crashes, shutdowns, or hardware symptoms
Common problems and fixes
- Diagnostics won't start when holding D at boot
- Ensure you're pressing the key immediately at startup, and check keyboard connection on external keyboards.
- Test reports a reference code but no clear explanation
- Search the reference code on Apple's support site or provide it directly to Apple Support.
- Diagnostics can't run due to no internet connection
- Connect to Wi-Fi when prompted, as some diagnostic content is fetched online.
Tips and tricks
- Run Diagnostics before a hardware repair appointment to have a reference code ready
- Repeat the test if a first run is inconclusive, especially for intermittent issues
Frequently asked questions
Is Apple Diagnostics free to run?
Yes, it's built into every Mac and free to use at any time.
Does it fix problems it finds?
No, it only identifies issues; repairs require service through Apple or an authorized provider.
Can I run it on an Apple silicon Mac the same way?
The process differs slightly; on Apple silicon Macs it's accessed through the startup options rather than holding D.
Related settings
- Serial Number & CoverageThis is where you locate your Mac's serial number and check whether it's still covered by Apple's limited warranty or an AppleCare+ plan. You'll need the serial number for support calls, insurance claims, or verifying coverage before a repair.
- macOS RecoverymacOS Recovery is a built-in set of utilities for reinstalling macOS, restoring from a Time Machine backup, repairing a damaged disk, and resetting a forgotten password — all accessible without needing a working copy of macOS already running.
More Troubleshooting guides for macOS
- Erase & Reset MacErase All Content and Settings lets you wipe your Mac back to factory defaults — useful for major troubleshooting, or before selling, trading in, or giving away your device.
- Safe ModeSafe Mode starts your Mac with only essential system software and drivers loaded, skipping login items, most fonts, and system caches. It's a diagnostic first step used to determine whether a startup problem is caused by third-party software or a deeper system issue.
- Analytics & ImprovementsAnalytics & Improvements controls whether your Mac automatically sends crash reports and usage analytics to Apple, and optionally to third-party app developers, to help them find and fix bugs. It's separate from location services and general privacy settings, focused specifically on diagnostic and usage data.
- Activity MonitorActivity Monitor is macOS's built-in tool for seeing exactly what's using your Mac's CPU, memory, energy, disk, and network resources in real time, broken down by individual app and process. It's the first place to look when the Mac feels slow, hot, or the fan is running loudly.
- Disk Utility First AidRun Disk Utility's First Aid tool to check a disk or volume for directory and file system errors and attempt automatic repair.
- Console: View System LogsUse the Console app to view real-time and historical system logs, crash reports, and diagnostic messages generated by macOS and installed apps.