Mac OS 的属性列表文件plist装换

简介:

    Mac OS系统自身包含有转换plist的工具:plutil.其中-p是以human可读方式显示plist文件,而convert就是转换参数,其中支持的格式有:xml,二进制和json。下面拿一个实际例子测试下,该plist文件是二进制文件:

apple@kissAir: Contents$ls

Info.plist MacOS      Resources

apple@kissAir: Contents$cat I*

bplist00?



 !"#$%&'()*(WDTXcodeYDTSDKName_NSPrefPaneIconFile\CFBundleNameZDTSDKBuild_CFBundleDevelopmentRegion_CFBundleVersion_BuildMachineOSBuild_NSPrincipalClass]NSMainNibFile_NSPrefPaneSearchParameters_SSupportsSuddenTermination_CFBundlePackageType_CFBundleInfoDictionaryVersion_CFBundleExecutableZDTCompiler_CFBundleIdentifier_DTPlatformVersion\DTXcodeBuild_CFBundleSignature_NSPrefPaneIconLabel_DTPlatformBuildT0463Zmacosx10.6_FlashPlayerPreferences.png\Flash PlayerV10K549WEnglishZ15.0.0.239U12F45_FSPreferencesMain_FlashPlayerPreferencesTtrueTBNDLS6.0\Flash PlayerP_ com.adobe.flashplayerpreferencesRGMV4H1503T????\Flash Playe7?I^kv??????,Lal????????

      '28Lejos??????+?

显示其内容:

plutil -p I*

{

  "DTXcode" => "0463"

  "DTSDKName" => "macosx10.6"

  "NSPrefPaneIconFile" => "FlashPlayerPreferences.png"

  "CFBundleName" => "Flash Player"

  "DTSDKBuild" => "10K549"

  "CFBundleDevelopmentRegion" => "English"

  "CFBundleVersion" => "15.0.0.239"

  "BuildMachineOSBuild" => "12F45"

  "NSPrincipalClass" => "FSPreferencesMain"

  "NSMainNibFile" => "FlashPlayerPreferences"

  "NSPrefPaneSearchParameters" => "FlashPlayerPreferences"

  "NSSupportsSuddenTermination" => "true"

  "CFBundlePackageType" => "BNDL"

  "CFBundleInfoDictionaryVersion" => "6.0"

  "CFBundleExecutable" => "Flash Player"

  "DTCompiler" => ""

  "CFBundleIdentifier" => "com.adobe.flashplayerpreferences"

  "DTPlatformVersion" => "GM"

  "DTXcodeBuild" => "4H1503"

  "CFBundleSignature" => "????"

  "NSPrefPaneIconLabel" => "Flash Player"

  "DTPlatformBuild" => "4H1503"

}


转换:

apple@kissAir: Contents$plutil -convert xml1 I* -o ~/x


这是转换后的内容:

apple@kissAir: ~$file x

x: XML document text

apple@kissAir: ~$cat x

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>BuildMachineOSBuild</key>

<string>12F45</string>

<key>CFBundleDevelopmentRegion</key>

<string>English</string>

<key>CFBundleExecutable</key>

<string>Flash Player</string>

<key>CFBundleIdentifier</key>

<string>com.adobe.flashplayerpreferences</string>

<key>CFBundleInfoDictionaryVersion</key>

<string>6.0</string>

<key>CFBundleName</key>

<string>Flash Player</string>

<key>CFBundlePackageType</key>

<string>BNDL</string>

<key>CFBundleSignature</key>

<string>????</string>

<key>CFBundleVersion</key>

<string>15.0.0.239</string>

<key>DTCompiler</key>

<string></string>

<key>DTPlatformBuild</key>

<string>4H1503</string>

<key>DTPlatformVersion</key>

<string>GM</string>

<key>DTSDKBuild</key>

<string>10K549</string>

<key>DTSDKName</key>

<string>macosx10.6</string>

<key>DTXcode</key>

<string>0463</string>

<key>DTXcodeBuild</key>

<string>4H1503</string>

<key>NSMainNibFile</key>

<string>FlashPlayerPreferences</string>

<key>NSPrefPaneIconFile</key>

<string>FlashPlayerPreferences.png</string>

<key>NSPrefPaneIconLabel</key>

<string>Flash Player</string>

<key>NSPrefPaneSearchParameters</key>

<string>FlashPlayerPreferences</string>

<key>NSPrincipalClass</key>

<string>FSPreferencesMain</string>

<key>NSSupportsSuddenTermination</key>

<string>true</string>

</dict>

</plist>



相关文章
mac上datagrip.vmoptions文件编辑错误导致DataGrip软件打不开
mac上datagrip.vmoptions文件编辑错误导致DataGrip软件打不开
|
4月前
|
Python
python如何使用os模块进行文件和目录操作?
python如何使用os模块进行文件和目录操作?
|
5月前
|
iOS开发 MacOS
Mac 解决安装软件文件已损坏,打不开,您应该推出磁盘映像
Mac 解决安装软件文件已损坏,打不开,您应该推出磁盘映像
194 0
|
5月前
|
IDE 开发工具 计算机视觉
关于opencv在PyCharm中没有提示的解决方案mac和win通用(不是改文件和复制)
由于最近有项目需要使用到IDE的debug功能,jupyter notebook没有debug功能,所以需要使用PyCharm。平时使用jupyter的时候也没有遇到opencv没有提示的问题,所以遇到这个问题的时候上网搜索了各种方法包括但不限于:复制文件,修改init文件,降低opencv版本等一系列方法都无效。我在三天内重装了5次系统n次anaconda,终于在最后解决了这个问题,放在这里供大家参考。
|
6月前
|
调度 iOS开发 开发者
Mac提示文件:已损坏,无法打开。你应该把它移到废纸篓
Mac提示文件:已损坏,无法打开。你应该把它移到废纸篓
153 0
|
4月前
|
iOS开发 MacOS
MAC OS更新系统后IDEA中的SVN报错无法使用
MAC OS更新系统后IDEA中的SVN报错无法使用
|
2月前
|
存储 数据安全/隐私保护 Swift
使用MAC如何打开远程服务器和文件管理工具
使用MAC如何打开远程服务器和文件管理工具
|
3月前
|
iOS开发 MacOS
Mac终端工具Terminal (4):在Mac上的终端中指定文件和文件夹
Mac终端工具Terminal (4):在Mac上的终端中指定文件和文件夹
|
4月前
|
存储 数据库 数据安全/隐私保护
【王道考研操作系统】—文件的基本操作
【王道考研操作系统】—文件的基本操作
|
5月前
|
Windows
软件打不开,文件找不到了,如何找到隐藏文件?(windows和mac解决方案)
软件打不开,文件找不到了,如何找到隐藏文件?(windows和mac解决方案)
软件打不开,文件找不到了,如何找到隐藏文件?(windows和mac解决方案)