Diagnosing diagnostics and Apple Hardware Test

If you want to check your Mac’s hardware out, the first step is to run Diagnostics or Apple Hardware Test, which are detailed here. When you follow those instructions – disconnect all non-essential peripherals, connect keyboard and mouse/trackpad via USB, hold the D key and start up – eventually you should see the diagnostic test on offer. But what if you don’t?

It’s worth checking that you are following the instructions in detail. Apple recommends that, rather than restarting into Diagnostics, you should enter it after shutting down, preparing your Mac, then starting up. Your Mac also can’t enter Diagnostics while it has a firmware password enabled. You’ll first need to disable that in Recovery mode, then shut down, wait a minute or two, and start up with the D key held.

The fallback if those fail is to ensure that your Mac has both a Wi-Fi and wired Ethernet connection if possible, and repeat the startup with ⌥D (Option-D) instead. This should, provided your Mac can gain an Internet connection, run remote Diagnostics from Apple’s support site instead. You should use both Internet connections if possible, to give this maximum flexibility; you should normally run Diagnostics with a Wi-Fi network available in any case, or its Wi-Fi tests won’t be possible.

Mac models introduced before June 2013 don’t of course run Diagnostics as such, but an older version named Apple Hardware Test, or AHT, and it’s those which are most prone to being unable to run locally, because of the way in which AHT is installed. Indeed, the oldest Intel Macs can’t even run AHT from their boot disk, and you’ll need to insert the original install (optical) disk supplied with that Mac.

Macs that were made between about 2007 and May 2013 normally run AHT from code which is hidden away in /System/Library/CoreServices/.diagnostics, which often seems to get wiped and not restored when you replace the internal storage, or perform a clean re-install. Those can easily leave your Mac relying on remote AHT unless the contents of that folder are replaced.

Unfortunately, because of SIP, restoring a local copy of AHT isn’t easy. You need a copy of the correct version of AHT not just for your Mac model, but for its specific series of logic board. Most users don’t go through the process of trying to put it back in place, but instead install it on a bootable USB memory ‘stick’ instead, where they know that it won’t be at risk of being wiped again. A large collection of links to different versions of AHT and full instructions are provided here.

More recent Macs don’t seem to keep their Diagnostics software in the same location – and those with a T2 chip certainly don’t. I deliberately avoided including the Diagnostics boot process in my summary of booting the Mac, because so little seems to be known about it. But I’d be most surprised if Macs with T2 chips don’t protect their Diagnostics within their Secure Boot process, perhaps even within boot.efi itself.

Unless you enjoy tinkering with macOS internals, if you can’t get your Mac to enter Diagnostics mode using the D key, it’s probably simplest to shrug and use ⌥D (Option-D) instead, and not to worry about restoring its local copy of the Diagnostics or AHT software.

However, if your Mac can’t run Diagnostics locally, you’d also be wise to check that it has a functional Recovery partition, in case that wasn’t configured properly as well. Not only can you test this by trying to start up in Recovery mode, but you should be able to identify it using the
diskutil list
command, where your startup disk should have a volume named Recovery, whether it’s in HFS+ or APFS format. As this isn’t mounted during normal running, you won’t see it in the Finder or Disk Utility.

Replacing a Recovery partition isn’t a simple task either. One example of doing so is given here, and the AppleScript tool to simplify that is available from here.

Problems like these with Diagnostics/AHT and Recovery partitions are unusual, if not downright rare. But when they happen, they are more than inconvenient. Sadly the treatment is usually worse than the illness itself.