If the Dock fails to relaunch after killing it, is there any way to force it to relaunch?

Every now and then I encounter an issue or bug in macOS that requires me to kill the Dock process. (For example, oftentimes some of my keyboard shortcuts for switching spaces stop working and the only way to fix it is to restart the Dock.)

However, sometimes when I kill the Dock it will fail to automatically relaunch, leaving my system in an unusable state. Aside from something like rebooting or logging out of my user account and logging back in again, is there anyway I can force the Dock process to launch again?


Solution 1:

I have finally found the answer to this question. If the Dock fails to relaunch, execute the following shell commands:

launchctl stop com.apple.Dock.agent
launchctl start com.apple.Dock.agent

The second command may not be necessary but should probably be included anyway just to be safe. This is probably a much safer way to restart the Dock than simply killing it.

Solution 2:

The Dock.app can be found at /System/Library/CoreServices/Dock.app so you can re-launch it by using the Finder's "GO" menu to "Go To Folder…" and put in /System/Library/CoreServices. Then double-click the Dock.app like any other app.

Or go to Terminal.app and enter:

open -a Dock

Either of those should re-start the Dock. However, if it didn't restart on its own, it might not work to re-start it manually, and you have reboot/logout&login, but at least you'll know what to try.

Solution 3:

If the following doesn't work after clicking menu "Go->Utilities->Terminal" (which you must have done to access "kill"), and it does not automatically restart following,

killall Dock

I would then download Onyx, a highly regarded app not on the AppStore, which a lot Mac users know about, and use the "Parameters menu" and therefore click "Dock" menu and hit the button "restore the Dock" at the bottom of the page. I took a picture if you want it uploading. Just to note, this an attempt at a more permanent fix and will trigger a restart. There are other approaches in Onyx that may help, notably clicking the "rebuilding LaunchServices", in the Maintenance menu. Either Onyx approach might help remove the underlying bug.

If you are running Sierra, this appears to be a known bug and the following article may be of help, here