Sub topic 19
Troubleshooting and resetting
This chapter assumes you have read the earlier chapters on the menu bar, the Dock, and the defaults command. You should be able to open System Settings and Terminal. Here you will diagnose common desktop problems and undo your customizations.
Start with the least invasive fix
Most desktop problems come from a setting that is on when you expect it to be off, or from a process that has stopped responding. Work from the cheapest check to the most drastic.
- Check System Settings for a setting that explains the symptom.
- Restart the process that draws the affected part of the screen.
- Remove the preference you changed from Terminal.
- Log out and back in, or restart the Mac.
The Dock, the menu bar, and the desktop are drawn by background processes that macOS restarts on its own after you quit them. This is why killall Dock is safe. The Dock disappears for a moment and returns with its saved preferences.
The Dock is missing
A Dock that does not appear is usually hidden, not gone. Check these causes in order.
- Auto-hide is on. Move the pointer to the edge where the Dock lives. If it slides in, auto-hide is enabled. You can turn it off in System Settings under Desktop & Dock, or press Option-Command-D to toggle it.
- The Dock is on a different edge. Someone may have set it to the left or right. Try all three edges.
- You are using several displays. The Dock shows on the display where your pointer reaches the Dock's edge. On a multi-display setup, push the pointer against that edge on each display.
- The Dock process is stuck. Restart it from Terminal:
killall DockTo see what the Dock is currently configured to do, read its preferences:
defaults read com.apple.dockThis prints every key stored for the Dock. Look for autohide, orientation, and tilesize. A key that is missing means the default is in use.
The Dock behaves strangely
| Symptom | Likely cause | Fix |
|---|---|---|
| Icons are tiny or huge | `tilesize` or the magnification setting changed | Change the Size slider in Desktop & Dock, or delete `tilesize` |
| Recent apps appear at the right end | Show suggested and recent apps is on | Turn it off in settings, or set `show-recents` to false |
| Dock appears when you do not want it | Auto-hide is on, or a hot corner is firing | Check Desktop & Dock and Hot Corners |
| An app icon will not go away | The app is running, or it was pinned with "Keep in Dock" | Quit it, then drag the icon off the Dock |
| Dock is on the wrong edge | `orientation` was changed | Set the position in settings, or delete `orientation` |
| Bouncing icon never stops | The app is hung | Force quit it from the Apple menu |
Be aware that an app icon with a dot beneath it is running. If you remove it from the Dock while the app runs, it stays in the Dock until you quit it. That is normal behavior, not a fault.
The menu bar is hidden or crowded
A menu bar that is missing is almost always set to hide automatically. In System Settings, open Control Center and find the option that hides and shows the menu bar automatically. It has choices such as always, in full screen only, on desktop only, and never. The exact wording differs between macOS versions. Setting it to never keeps the bar visible. A window in full-screen mode also hides the menu bar until you move the pointer to the top edge.
A crowded menu bar has two typical symptoms:
- Icons are missing. On a Mac with a camera housing (the notch), items that do not fit can slide out of sight behind it. Apps with many menu bar extras are the usual cause. The items still run, but you cannot click them.
- The bar is full of items you never use. This clutters the screen and causes the first symptom.
To declutter, hold Command and drag an item off the menu bar until it disappears. Built-in items can also be turned off under Control Center settings. Third-party items are controlled by the app that owns them, usually in its own preferences.
If a built-in item such as Wi-Fi or the clock freezes, restart the process that draws it:
killall ControlCenterOn older macOS versions, some items belong to SystemUIServer instead. Use killall SystemUIServer there. Either command is safe, since macOS relaunches the process.
Resetting the Dock from Terminal
When a Dock problem survives a restart, remove the keys you changed. You do not need to know their previous values, because a deleted key falls back to its default.
defaults delete com.apple.dock autohide
defaults delete com.apple.dock tilesize
defaults delete com.apple.dock show-recents
defaults delete com.apple.dock orientation
killall DockIf a key was never set, defaults delete prints an error saying the pair does not exist. That error is harmless. It means that setting was already at its default.
Back up before a full reset
If you decide on a full reset, save a copy first so you can restore your layout:
defaults export com.apple.dock ~/dock-backup.plist
defaults delete com.apple.dock
killall DockTo restore your old Dock later, import the file and restart the Dock:
defaults import com.apple.dock ~/dock-backup.plist
killall DockWhen a setting will not stick
Sometimes you change a Dock setting and it reverts. Common reasons:
- You forgot
killall Dock. The Dock reads its preferences at launch, so adefaults writehas no visible effect until it restarts. - A typo in the key or type.
defaults write com.apple.dock autohide truewithout-boolmay store a string instead of a Boolean. Always give the type flag, as in-bool true,-int 48, or-string left. - A device management profile controls the setting. On a work or school Mac, an administrator may enforce Dock settings. System Settings shows these options dimmed, and your changes are overwritten. Ask your administrator.
- Misspelled values. For
orientation, onlybottom,left, andrightare valid.
The last resorts
If the Dock or menu bar still misbehaves after you delete preferences and restart the processes, log out and back in. This restarts every per-user interface process. A full restart is the next step. If the problem occurs only for one user, create a test user account. If the test account is fine, the problem is in your account's preferences, not in macOS itself.
Exercise
You ran defaults write com.apple.dock orientation -string left and the Dock did not move. What was the most likely missing step, and what single command undoes the change after you fix it?
Show answer
The Dock was not restarted, so run killall Dock to make it read the new preference. To undo the change, run defaults delete com.apple.dock orientation followed by killall Dock.
Exercise
A coworker's Wi-Fi and clock icons vanished from the right side of the menu bar on a MacBook with a notch, but the apps are still running. Name two likely causes and one fix.
Show answer
The menu bar may be hiding automatically, or too many menu bar extras may have pushed items behind the notch. Command-drag unused items off the bar to free space, or turn off items under Control Center settings.
Exercise
Why should you run defaults export com.apple.dock ~/dock-backup.plist before defaults delete com.apple.dock?
Show answer
Deleting the whole domain also removes your pinned apps and folders. The exported file lets you restore that layout with defaults import.