Cmd-Tab suddenly stopped working, and my Dock is unresponsive, what do I do?
Your Dock has become unresponsive. It's rare, but it does sometimes happen. To fix it you just need to kill the Dock app and it will automatically restart. To kill the Dock:
Go to Applications ➔ Utilities ➔ Terminal.app
Type killall Dock
If that doesn't work, type killall -9 Dock
The Dock will vanish for a few moments and then pop back up good as new. None of your apps should be affected.
Edit: sudo killall Dock
would kill other users' docks, and isn't even more likely to work. Thanks derober for pointing that out. killall -9 Dock
is the right command
http://blog.peterhaza.no/cmd-tab-and-dock-not-working-in-os-x/
And so I fired up Activity Monitor and force killed Dock. Two seconds later my Dock popped up and ⌘ ⇥ worked again.
Another option for reference purpose for those that do not want to use terminal and this works even if the dock is hanging:
Alt+Cmd+esc will open the Force Quit Applications window and you can kill finder from there. Also right-clicking on the dock area should popup a Force Quit option if the dock is unresponsive.
This is an alternative for those that can't find their way around in the terminal