I have replaced original hard drive to samsung SSD and upgraded memory too.
I have now installed El Capitan and want to run Apple Hardware Test.
I have already tried 'D' , Option + 'D' both didn't do anything.
I have checked under "/System/Library/CoreServices" and no ".diagnostics" folder. I tried to copy this folder to CoreServices and not able to do that since error message says no permission.
sudo cp -R /Volumes/AppleHardwareTest/System/Library/CoreServices/.diagnostics /System/Library/CoreServices WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. Password: cp: /System/Library/CoreServices/.diagnostics: Operation not permitted cp: /Volumes/AppleHardwareTest/System/Library/CoreServices/.diagnostics: unable to copy extended attributes to /System/Library/CoreServices/.diagnostics: Operation not permitted cp: /System/Library/CoreServices/.diagnostics/diags.efi: No such file or directory cp: /System/Library/CoreServices/.diagnostics/Mac-F42386C8: No such file or directory