Mac OS X - Restart the Dock

The Dock in Mac OS X freezes sometimes, or behaves erradically. Today I noticed that the icon for the Finder was no longer showing in my Dock and after restarting the Finder, it still didn’t show up. This was my clue that something was broken with the Dock.

This how-to article shows two different ways to restart a frozen Dock. The first use OS X’s Terminal (shell) application, the second uses AppleScript. You can decide which method is easier for you.

Restart your OS X Dock from the Terminal

  1. Open from /Applications/Utilities/Terminal
  2. Type the command: "ps -auxww | grep Dock", then press the Enter key. You should see a listing similar to this (note, I’ve had to wrap the longer lines):
    $ ps -auxww | grep Dock
    wkw   7563   0.0  1.0   149188  10112  ??  S
             5:42PM   0:05.46 /System/Library/…/Dock -psn_0_128188417
  3. You want to locate the Process ID for the Dock, that’s the first number you see reading from left to right (the number underlined above). My Dock’s PID is 7563. Now substitute your Dock’s PID into the command in the next step (where it says your_pid). We will now terminate that process with the kill Unix command.
  4. Type into Terminal, "kill -HUP your_pid" and press the Enter key.

Your Dock should disappear after that and in a couple seconds reappear. Any windows which were minimized on the Dock will be maximized when it Quits.

Restart your OS X Dock with AppleScript

This method of restarting the Dock is quite simple too. Just open the AppleScript Script Editor located at /Applications/AppleScript/Script Editor and type or paste the line below into the editing window:

quit application "Dock"

Run the script and the Dock should be magically quit and restarted. Note however that sometimes the Dock will not be able to respond to this Apple Event, so for those cases you will have to use the Terminal technique above.

If you have other useful Mac OS X tips you’d like to share, please leave them in a comment.

Leave a Reply

You must be logged in to post a comment.