Working around an infamous macOS Sierra Dock bug
Lately I’m running more and more into an infamous macOS bug whereas the Dock.app somehow hangs leaving the macOS GUI in a semi-stuck state in which, depending on the odds, you might find yourself unable to:
Launch Mission Control (either via keyboard or hot corner).
Launch any app from the dock (sometimes clicking and holding on a dock icon does bring up the contextual menu though the menu itself doesn’t react to any clicks whatsoever).
Launch Spotlight (either via keyboard shortcut or by clicking its icon in the menu bar).
Force quit any app (pressing CMD-ALT-ESC will bring up the force quit window though it doesn’t react to any clicks whatsoever).
Something else: YMMV.
The only symptom that happens 100% of the times is the inability to launch Mission Control, the others happen randomly.
When does this happen?
Though I can’t seem to reliably reproduce the bug, it usually happens right after dragging a recently downloaded file from the Downloads stack in the dock to the desktop.
If the dock icons are still clickable and/or Spotlight can still be launched the workaround is trivial:
Launch the Terminal app from either Spotlight or from a Dock shortcut (if you have one) and run the
killall Dock command.
A little less than trivial workaround
If the GUI is stuck so much you can’t launch the Terminal app in any way or you can’t type any command in it because the keyboard input is stuck too then your only chance is to force shutdown your Mac and start over.
You can be proactive and prepare a better workaround that should work most of the times:
- Open the Script Editor application and create a new AppleScript with the following line inside:
do shell script "killall Dock"
- Save it in the Applications folder with file format Application and file name Kill Dock.app
- Use Siri to launch this newly created AppleScript Application whenever your Dock gets stuck. As strange as it may seem, Siri stays fully operational after the Dock hangs, so just hit the Siri key on the keyboard (or Touch Bar) and tell Siri: “open Kill Dock”.
Voila: Siri will launch the AppleScript command and reset your dock for you.
Hope this helps.
It seems that the macOS Sierra 10.12.3 update fixed this bug. A workaround is no longer needed therefore.