Many apps require a way to store data like app preferences.
Knowing where app preferences are stored and how to manipulate them gives administrators
greater control over a user's experience with an app.
If using an MDM provider like Jamf Pro, app preferences can even be configured and deployed
remotely.
Jeremy here, and I'll walk you through app preferences with the macOS interface.
In iOS, app preferences are stored in the app sandbox, so deleting an app also removes
all of its saved data.
However, in macOS, app preferences are not stored with the app.
Instead, they're oftentimes found in the root Library and user Library Preferences directories
in the form of property list files, sometimes referred to as plists due to their file extension.
Plists affect how macOS and apps function.
Using the Finder, let's locate some plist files.
I'll begin at the root level by clicking Go, choosing Computer, then selecting Macintosh
HD.
Taking a look at the root Library Preferences directory, there are several plists beginning
with com.apple.
This is a pretty standard naming convention for plists, where each one begins with com
followed by the developer or app name, and then the feature it's affecting.
For example, com.apple.FindMyMac is a plist indicating whether or not the Find My Mac
feature is enabled.
Double-clicking a plist will display a message that there is no app set to open it.
Apps like Xcode by Apple, or other third-party text editors, can create new, or open and
edit existing plist files.
Or you can simply read the file by using Quick Look by selecting it and pressing the space
bar.
Since I haven't yet enabled Find My Mac, the FMMEnabled key is set to false.
Otherwise, if I enable Find My Mac in the Apple ID pane of System Preferences, the value
is now true.
Plists in the root Library directory will affect all users on the computer, so some
apps place a license key here in the form of a plist.
By placing the license key nested in the root Library directory, the app it's associated
with will be registered for all users on this computer.
But what about user-specific preferences?
In the Users directory, each user has a home folder with its own Library directory.
This is hidden from view in the Finder by default, but can be accessed from the Go menu.
Simply press and hold the Option key to reveal the current user's Library and click to select
it.
In the Finder window, locate the Preferences directory and examine its contents.
Here are many more plists for macOS and app preferences.
But since these are nested in a user's home folder Library, they'll only affect this user.
For example, select the com.apple.dock plist and view it with Quick Look.
This is a quite lengthy XML document, but if you look closely you'll start to see the
layout of the Dock.
The long string of characters here is an icon.
Below that you'll find the bundle identifier and, farther down, the path to the app.
This pattern continues for each icon in the Dock.
If an app were to be added to the Dock, that change will be reflected in this user's dock
plist.
However, while adding an item from the Dock affects change to the interface immediately,
this change might not appear in the plist file right away.
This is due to a macOS process called cfprefsd.
In short, cfprefsd is a process that caches information in your Mac's RAM before writing
it to the plist files, to prevent an unnecessarily high amount of writes to the disk.
After a few moments have passed, the plist will be modified with the appropriate changes.
Since app preferences are stored in Library directories, that data remains if an app were
to be deleted.
Some app developers create their own uninstaller that removes this data in addition to the
app.
However, if an uninstaller isn't used or if the app is simply deleted, it can be reinstalled
and all of the previous app preferences are available.
If managing your Macs with an MDM provider like Jamf Pro, plists can be configured and
deployed remotely to control app preferences.
That's all for our video on app preferences.
Thanks for watching, and we encourage you to continue learning!