MacOS – Cannot shut down computer due to app not responding

applicationsforce quitmacosshutdownxcode

I have a 2012-ish MBP and I am using it to develop iOS apps using Xcode. This app stops responding relatively frequently, but usually I can just force quit it and open it again. However, this time I cannot Force Quit Xcode, although there is no 'dot' beneath it in the dock, right clicking the icon just shows the 'not responding' message. I have attached a screenshot.

See the bottom right

This is preventing me from shutting down my computer. How can I fix this?

I hope my description is clear enough to make this a good question.

Best Answer

If you don't mind using the Terminal.app, I would suggest trying:

sudo shutdown -h now

(-h is for 'halt')

That should shut the computer off as cleanly as possible, and is better than holding the power button down.

If you want to reboot instead of shutting down, try this instead:

sudo shutdown -r now

n.b. This assumes you have an administrator account. You will be asked to enter your login password when you use sudo.