I assume you mean kernel panic:
Kernel Panic, though sounding scary, is simply an occurrence when your Mac restarts for no obvious reason. Your Mac’s screen goes black giving you various warning messages like “You need to restart your computer.” Note that the presence of the warning message is what distinguishes Kernel Panic from usual Mac restarts and app crashes. In other words, Kernel Panic is just a Mac version of “blue screen of death” on Windows.
To start a kernel panic, you can issue the following command from Terminal:
sudo dtrace -w -n "BEGIN{ panic();}"
You will need to disable SIP if you have El Capitan or later. You can find instructions to do it here. It works for any version of macOS that has SIP, but you should NOT do it unless you really need to, since it is a security risk. If you do, you should re-enable it when your work is done.
Or an even better option is to test your software in a virtual machine using a virtualization software like Parallels or VMWare. This way, you won't damage your computer in any way.
This is not completely harmless if you try it on your actual machine instead of a VM. There is no completely harmless way of crashing your system. In my case, it didn't do any damage to my system, but you have been warned.
shutdown
orhalt
. – nohillside Feb 16 '18 at 08:30shutdown
" is that it doesn't seem like a true and blue crash. I'm trying to test the behavior of a true "pullplug", but of course in a way as close as possible without hurting my hardware. There are windows apps that can be downloaded which actually crashes the OS when they run; I'm looking for such stuff for Mac. – Pacerier Feb 16 '18 at 08:37