Sub topic 6
Reset one app's preferences
This chapter assumes you can open Finder and Terminal, you know how to find an app's name and bundle identifier, and you have a current backup (Time Machine or a copy of the files you care about). It follows the chapters on force quitting and backups.
Why preferences cause trouble
Each app stores its settings in a preferences file, usually a .plist file in your user Library folder. If that file is damaged, the app can crash on launch, forget its settings, or behave oddly. Other apps and your documents are unaffected, so you can fix the one app without touching anything else.
Reset preferences after a force quit and a restart have not helped, and before you try heavier steps such as safe mode or a new user account.
Find the preference file
The file name uses the app's bundle identifier, a reverse-domain label such as com.apple.dock. To find an app's identifier, run this in Terminal, replacing the app name:
osascript -e 'id of app "Safari"'The preferences live in ~/Library/Preferences/. The ~ stands for your home folder. The Library folder is hidden by default. In Finder, choose Go > Go to Folder and type ~/Library/Preferences.
Some apps also keep data in ~/Library/Containers/ or ~/Library/Application Support/. Leave those alone at first, because they can hold real data such as accounts and saved work.
Move the file, don't delete it
Moving the file to a backup folder gives you an undo. Quit the app first, then run this, replacing com.example.App with the identifier you found:
mkdir -p ~/Desktop/prefs-backup
mv ~/Library/Preferences/com.example.App.plist ~/Desktop/prefs-backup/Open the app again. It creates a fresh file with default settings. If the problem is gone, the old file was the cause. If nothing changed, quit the app and move the file back to restore your settings.
macOS caches preference data in a background process, so a change can appear not to take effect. If the app still shows old settings, log out and back in, or restart the Mac, then try again.
Reset the Dock
The Dock is a process rather than a normal app, so you reset it with the defaults command, which reads and writes preferences directly:
defaults delete com.apple.dock
killall DockThe first line removes all of your Dock settings, including its size, position and the apps pinned to it. The second line restarts the Dock, and macOS relaunches it with defaults. Because this deletes without a backup, export the settings first if you want a way back:
defaults export com.apple.dock ~/Desktop/prefs-backup/dock.plistCommon errors
- No such file. The app may be sandboxed, or may not use that identifier. Search
~/Library/Preferences/for part of the app's name. - Wrong file removed. Keep the backup folder until you are sure the app works. Moving the file back restores it.
- Permission problems. Do not use
sudoto move files in your own Library. That can leave root-owned files that cause new problems. - Settings return. Some apps sync settings through iCloud or an account, so a reset may reload the old values.
The decision path looks like this:
Exercise
An app crashes every time you open it. You have quit it and restarted the Mac. Describe how to test whether its preferences are the cause, and how to undo the test.
Show answer
Find the app's bundle identifier, quit the app, and create a backup folder. Move ~/Library/Preferences/<identifier>.plist into it with mv, then relaunch the app. If it now opens normally, the old preference file was damaged. If it still crashes, quit the app and move the file back from the backup folder to restore your settings, then continue with safe mode or a new user account.