What is cfprefsd on a Mac, and why deleting a .plist does not reset an app
cfprefsd keeps every app's preferences in memory and writes them to disk. That is why a deleted .plist can come straight back. How to reset an app properly.
What is cfprefsd?
cfprefsd is the preferences daemon. Apps do not read their .plist files in ~/Library/Preferences directly; they ask cfprefsd, which keeps the values in memory and writes changes back to disk when it chooses. It lives at /usr/sbin/cfprefsd. On our Mac two copies ran, one as root for system wide settings and one as us, at 0.0% CPU and 2 to 3 MB.
Why did my deleted settings come back?
Because cfprefsd still had them in memory. Delete the file while it is cached and cfprefsd writes it out again, unchanged, the next time anything touches that app's settings.
How do I reset an app's preferences properly?
- Quit the app.
- Ask cfprefsd to forget them, using the app's bundle identifier:
defaults delete com.example.appOr delete the .plist and then restart cfprefsd so its cache is dropped. It restarts on its own:
killall cfprefsdPreferences for sandboxed apps live in their container instead, ~/Library/Containers/<id>/Data/Library/Preferences, and the same rule applies. See the Preferences folder.
See it live
Free Mac's System tab ranks every process by processor use and energy impact, once a second, and marks the ones macOS will not let you quit as protected. See also what is safe to delete in Library.
Related: opendirectoryd high CPU and sharingd.
Common questions
What is cfprefsd on a Mac?
The macOS preferences daemon. It holds apps' settings in memory and writes them to their .plist files.
Why do deleted plist files come back on a Mac?
cfprefsd still had the settings cached and wrote them back. Quit the app and use defaults delete, or killall cfprefsd after deleting.
Is it safe to killall cfprefsd?
Yes. macOS restarts it at once. Unsaved settings changes from running apps may be lost, so quit them first.