Pist editor or pure print method without Xcode

I need to exchange information with plist with someone who is not technically inclined. Is there a regular free editor that can be used to view plist information in the same way that it is presented in Xcode? Or is there a way to print it?

In other words, I would like to view plist without any xml-like brand and without using Xcode.

+4
source share
4 answers

There is a property list editor application as part of OS X (or it used to be, I’m not in the car right now, so I can’t check it).

Otherwise, you can write one in half an hour!

0
source

The standalone “Property List Editor” disappeared with Xcode 4, you can use the Pref Setter , which is free, but last updated 4 years ago.

To save content without xml tags, see this example:

NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[@"~/Library/Preferences/loginwindow.plist" stringByExpandingTildeInPath]]; [[dict description] writeToURL:[NSURL fileURLWithPath:[@"~/Desktop/loginwindow.txt" stringByExpandingTildeInPath]] atomically:YES encoding:NSUTF8StringEncoding error:nil]; 
+3
source

Command line options for viewing Plist files:

  • View only . Use plutil -p , which prints the contents of the property list in JSON format (the format is for human consumption only).

Example (append | open -tf for viewing output in a text editor):

 plutil -p ~/Library/Preferences/com.apple.sidebarlists.plist 
  • Alternative . Use /usr/libexec/PlistBuddy -c print , which /usr/libexec/PlistBuddy -c print in JavaScript-object-literal-like format:

Example:

 /usr/libexec/PlistBuddy -c print ~/Library/Preferences/com.apple.airplay.plist 

Caveat : If plist has properties containing binary data, PlistBuddy will include it in its raw form (on the contrary, non-binary properties in the same file print correctly). If XML output is required, add the -x option.

Please note that PlistBuddy :

  • can be used to retrieve properties selectively using : -separated, case-sensitive path properties; e.g. /usr/libexec/PlistBuddy -c 'print :favorites:ShowRemovable' ~/Library/Preferences/com.apple.sidebarlists.plist
  • it is also capable of modifying Plist files from the command line (including, with limitations, importing from previously exported files into XML).

See /usr/libexec/PlistBuddy -h more details.

+3
source

There is a way to get an old property list editor that works with Mac OS X Lion if you don't want to use bloated Xcode 4 for this.

+1
source

Source: https://habr.com/ru/post/1398846/


All Articles