Deep understanding of preference files: location:
Storage of preference settings files for systems and applications can be classified into two categories in Mac OS X systems: one is the system category and the other is the user category.
The preference settings of the system or global system are stored in the system category. In contrast to the user category, the user category is intended for different users and user-defined preferences.
Specifically, the system category is stored in the/library/preferences/directory, while the user category is stored in ~ /Library/preferences/directory (Note 1
).
Note 1
: In the system ~ Symbol represents the user's home directory. For example, if the user's home directory of student is in/users/student,
Then ~ It is equal to/users/student,
And ~ /Library/preferences/is/users/student/library/preferences /.
Two types of plist files
- Specified hardware location (byhost preference)
The MAC system supports preference settings for specific hardware. These preference files are stored in the byhost directory. You can ~ /Library
/Preferences/byhost/, for different systems (software and hardware), Mac OS
The X system or application may store the preference setting file in byhost, so that all the settings involved in this file are only related to the computer itself.
The byhost preference setting file has a special file name to indicate that it is related to the system hardware. In versions earlier than Mac OS X 10.5, the preference setting file name used by the system is different from adding the MAC address of the NIC to a common file name, for example:
Com. Apple. screensaver.001122334455.plist is the preferred configuration for setting screen protection.
In Mac OS X
After 10.5, in order to better identify the uniqueness of the system, it uses the system UUID to replace the content of the original MAC address. For example, the above screen protection preferences are:
Com. Apple. screensaver.27074f01-7a93-5859-baf3-0eb138e001d3.plist
Why must we use byhost configuration?
Some program preference settings can indeed be attributed to hardware-related, and some are for program features. In addition to the screen saver mentioned above, there are also settings for imagecapture to use that program.
Set to byhost.
Capture. app or iPhoto. app, there is an option in their preferences which is used to download photos, see Image
Preferences of capture. app:
If no value is set, no application is displayed. The Mac OS X system starts the corresponding program by using this preference configuration file.
In byhost, we can see that:
Com. Apple. imagecapture.27074f01-7a93-5859-baf3-0eb138e001d3.plist,
Its content is displayed in the property list editor. app as follows:
For example, it is easier to understand how to control the number of resolution supported by the current display, which is also stored in byhost. Is the option to display 10 resolutions:
Its plist file is shown as follows:
Also, if a program license is installed on only one machine, the byhost preference configuration is a convenient mechanism, for example, a program with copyright protection, such as iTunes, needs to save the unique identifier of the local user and create a signature with the copyright information to prevent piracy.
How can I find this UUID? Run the following command in terminal:
Ioreg-D2-C ioplatformexpertdevice |
You can see the following content on an iMac:
+-O imac8, 1 <class ioplatformexpertdevice, registered, matched, active, busy 0, retain 23>
{
"Iobusyinterest" = "iocommand is not serializable"
"Iointerruptcontrollers" = ("io-apic-0 ")
"Ioplatformserialnumber" = "ymxxxxxxxxx"
"Clock-frequency" = <005a6b3f>
& Quot; version & quot; = & quot; 1.0 & quot;>
"Product-name" = <"imac8, 1">
"Iointerruptspecifiers" = (<0900000005000000>)
"Board-ID" = <"Mac-F226BEC8">
"Model" = <"imac8, 1">
"Serial-number" = <5xxxx2000000000000000000000000xxxxxxxxx4dxx5axxxx00000000000000000000000000000>
"Manufacturer" = <"Apple Inc.">
"Ioplatformargs" = <00c0xxx00050exxxxxxeef0000000000>
"Name" = <"/">
"Ioplatformuuid" = "FXXXXXX5-XXXX-XXXX-XXXX-82XXXXXXXX34"
"Compatible" = <"imac8, 1">
"Iopolledinterface" = "smcpolledinterface is not serializable"
"System-type" = <01>
}
|
From the above content, you can find a line named "ioplatformuuid". This is the line. In order to locate it once, run the following command:
Ioreg-rd1-C ioplatformexpertdevice | grep "ioplatformuuid" |
This UUID is only supported by Mac OS X 10.5 and later versions. Another problem is that not all hardware systems support it, for example, the following is an earlier version of the iMac System (2007). The UUID is preceded by "00000000-0000-1000-8000
"The MAC address of the NIC is followed. In such a system, the uuid is not used as the identifier. Instead, the old method is used to directly use the MAC address.
"Ioplatformuuid" = "00000000-0000-1000-8000-00xxxxxxxx20" |
In systems earlier than Mac OS X 10.5, the command ioreg is also supported, but the option-rd1 or-D2 is not supported.
The global preference file is a special plist file, which exists in the system and user categories, but is generally not seen in the finder exit. It can be found in terminal.
/Library/preferences/. globalpreferences. plist or ~ /Library/preferences
/. Globalpreferences. plist files. They define system or global system parameters, such as time zone.
Common Tools
Common Graphics tools:
Property List editor: the preferred tool is of course the app in Apple's development tool, which is free and the main tool.
Plistedit
: You can open and process text and binary files and save them in the original format,
Plistedit pro
: Pay-as-you-go software, which is characterized by the XML plaintext and tree structure simultaneously.
Prefedit
: It is convenient to find plist files. Fees are charged for Version 2.0 and free for version 1.2.
Command line tool:
Plutil: it is mainly used to check plist File Syntax and convert plist files between text and binary.
Defaults: used to operate plist files, but there are limits when operating on multi-layer attributes; after 10.5, the text format is converted to binary format by default, which can improve the system reading speed.
Plistbuddy: it is a more flexible tool than ults. It can edit attributes of multiple layers at will, but it is not included in OS X.
Tony Liu
June 26,200 9 Calgary