upekkha / AppleHardwareTest

Apple Hardware Test Download Links
1.16k stars 134 forks source link

Apple Hardware Test (AHT)

Description

Apple computers ship with a pre-installed suite of hardware diagnostic tools, known as Apple Hardware Test (AHT). In principle you can start them by holding the D key while booting. Newer models support holding Option D to load AHT over the internet. Refer to the official Apple documentation for details: Using AHT on Intel-based Macs, Mountain Lion, Mavericks and Yosemite. Apple redesigned the AHT, now called Apple Diagnostics, for Macs introduced after June 2013. Consult the reference codes to interpret the results.

If however, you reinstalled an older computer from scratch, the diagnostic tools might no longer be available. Unless you have the original disks that came with your computer, there seems to be no way to restore the AHT.

It happens that Apple provides disk images with AHT for most computers, but does not make the links publicly available. Various blogs and forums, mostly Riven by Five and MacForum.ro have gathered a list of download links. The rest were obtained by scraping https://download.info.apple.com/Apple_Hardware_Test/ for all the links of the form 0(18|22)-\d{4}-A.dmg.

Even though there's no guarantee that this list is correct or complete, some links can come in very handy to whoever is trying to debug hardware problems.

You can use the following terminal commands to determine the model and board ID of your computer:

sysctl hw.model | awk '{ print $2 }'
ioreg -l | awk -F\" '/board-id/ { print $4 }'

Download the AHT for your computer model and use the contents to restore the /System/Library/CoreServices/.diagnostics folder, then reboot while holding D to start the diagnostic tools. Alternatively you may try with a bootable USB stick, as described below. This is also the preferred way on OS X 10.11 or later, where the System Integrity Protection (SIP) no longer allows writing to system folders.

When trying to open an old dmg you may get the error 'legacy image should be converted'. To convert it to a newer format, open Disk Utility, in the menu Images click on Convert and select the dmg to convert and save it under a new name.

Note that there is no one-to-one correspondence between hardware model and AHT. For some models no hardware test could be found, while others seem to have multiple AHT. As the differences are not clear, feel free to try them out, to see which one works best for your hardware.

Run AHT from a bootable USB stick

diskutil eraseDisk JHFS+ USBstick GPT disk2
cp -r /Volumes/AHT/System /Volumes/USBstick/
sudo bless --folder /Volumes/USBstick/ --file /Volumes/USBstick/System/Library/CoreServices/.diagnostics/diags.efi --label AHT

PowerMac

PowerBook

iBook

iMac

MacMini

MacPro

MacBook

MacBookPro

MacBookAir

Xserve

Misc

Hosted on third-party servers

This contains a .pkg that tries to install the AHT to your system folder. Alternatively, right-click it to show the package contents and unpack the Archive.pax.gz file inside. The extracted Archive/System/ folder contains the diagnostic tools and can be used to create a bootable USB stick, as with the other .dmg files downloaded from Apple.