Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2404261
  • 博文数量: 328
  • 博客积分: 4302
  • 博客等级: 上校
  • 技术积分: 5486
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-01 11:14
个人简介

悲剧,绝对的悲剧,悲剧中的悲剧。

文章分类

全部博文(328)

文章存档

2017年(6)

2016年(18)

2015年(28)

2014年(73)

2013年(62)

2012年(58)

2011年(55)

2010年(28)

分类: iOS平台

2016-11-04 04:01:38

PlistBuddy [-cxh] file.plist

Some of the configuration files in OS X (found in /System/Library/LaunchDaemons , etc) are in xml format (for example ftp.plist, (as of 10.9.5 233 XML, 21 binary), which can be edited with a text editor.

The "Apple binary property list" ones must be edited with PlistBuddy a command processor ( or the GUI )

-c command Execute command and exit. By default, runs in interactive mode.
-x Output will be in the form of an xml plist where appropriate.
-h help


Clear type Clears all entries, and creates root of type type.
Print [entry] Outputs value of entry or the entire file.
Set entry value
Add entry type [value]
Copy entrySrc entryDst Copies the entrySrc property to entryDst.
Delete entry
Merge file [entry] Adds the contents of plist file to entry.
Import entry file Creates or sets entry to the contents of file.
Revert Reloads the last saved version of the file.
Save
Help
Exit | Quit Changes are not saved to the file.

Entries consist of property key names delimited by colons (:). 
Array items are specified by a zero-based integer index.

Many property key names are program specific.


Examples

:CFBundleShortVersionString :CFBundleDocumentTypes:2:CFBundleTypeExtensions

Entry types: string, array, dict, bool, real, integer, date or data


Examples

Set the CFBundleIdentifier property to com.apple.plistbuddy:
Set :CFBundleIdentifier com.apple.plistbuddy

Add the CFBundleGetInfoString property to the plist:
Add :CFBundleGetInfoString string "App version 1.0.1"

Add a new item of type dict to the CFBundleDocumentTypes array:
Add :CFBundleDocumentTypes: dict

Add the new item to the beginning of the array:
Add :CFBundleDocumentTypes:0 dict

Delete the FIRST item in the array:
Delete :CFBundleDocumentTypes:0 dict

Delete the ENTIRE CFBundleDocumentTypes array:
Delete :CFBundleDocumentTypes


examples

> plistbuddy com.apple.TimeMachine.plist
Command: print
Dict {
    LastDestinationID = 577AB420-2EA6-4BED-8E03-4E1203DFD882
    MobileBackups = false
    HostUUIDs = Array {
        9205DB27-ADBE-5C67-B58F-AE743BF777D9
    }
    LocalizedDiskImageVolumeName = Time Machine Backups
    BackupAlias = & DGerman1a??lH+   DGerman1a??l????     DGerman1??????_DGerman1a:DGerman1a    DGerman1a   DGerman1a/Volumes/DGerman1a??? PreferencesVersion = 4
    RootVolumeUUID = 8CBD0C14-6A08-3663-A911-CE7D1DB594B0
    Destinations = Array {
        Dict {
            RESULT = 0
            BytesUsed = 267603189760
            DestinationID = 577AB420-2EA6-4BED-8E03-4E1203DFD882
            SnapshotDates = Array {
                Mon Mar 03 23:39:29 EST 2014
                Thu Mar 20 20:26:39 EST 2014
                Sat Apr 12 21:16:21 EST 2014
                Sat Apr 26 16:33:53 EST 2014
                Fri Jun 06 16:33:13 EST 2014
                Sat Jul 05 08:26:09 EST 2014
                Sun Sep 14 09:53:19 EST 2014
            }
            BackupAlias = & DGerman1a??lH+   DGerman1a??l????     DGerman1??????_DGerman1a:DGerman1a    DGerman1a   DGerman1a/Volumes/DGerman1a??? BytesAvailable = 212371472384
            DestinationUUIDs = Array {
                B2BA3CA8-984F-39F5-8A16-261BCBC2CE28
            }
        }
    }
    ExcludeByPath = Array {
        //Users/Shared/adi
        /Users/Shared/adi
        /Library/Application Support/Microsoft/PlayReady
    }
    AutoBackup = false
}

Command: print … ProgramArguments = Array { /usr/sbin/syslogd } … Command: delete ProgramArguments Command: add ProgramArguments array Command: add ProgramArguments:0 string "/usr/sbin/syslogd -d" Command: print … ProgramArguments = Array { /usr/sbin/syslogd -d } …



> plistbuddy com.apple.iokit.AmbientLightSensor.plistrray { /usr/sbin/syslogd -d } Command: print Dict { Lux 1 = 0.000000 Keyboard Muted = false LuxSensor 1 = 84.000000 LuxSensor 2 = 215.000000 Keyboard Dim Time = -1 Keyboard Manual Brightness = 1.000000 Keyboard User Offset = 0.261857 Lux 2 = 215.000000 Backlight 1 = 0.428367 Lux Threshold = 128.153519 Backlight 2 = 1.147028 Automatic Keyboard Enabled = true }

Errors

Encountered unknown tag galileoConfig on line 2
Error Reading File: galileo_config.xml

repost from 
阅读(3345) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~