Skip to main content

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

  1. Shut down the Mac completely
  2. Turn it on and immediately hold the D key (or use Startup Options on Apple silicon)
  3. Follow on-screen prompts to select a language and connect to Wi-Fi if needed
  4. 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.

More Troubleshooting guides for macOS

See every macOS guide