Editor or way to print plist in a clean way without Xcode
Asked Answered
T

5

12

I need to share information from a plist with someone who is not technically inclined. Is there a common free editor that one can use to view plist info in a similar way in which it is presented in Xcode? Or is there a way to print it out?

In other words I would like to view the plist without all the xml-like mark up and without the use of Xcode.

Theatrics answered 28/2, 2012 at 16:24 Comment(0)
B
0

There is a "Property List Editor" app as part of OS X (or there used to be, I'm away from my machine at the moment so can't check).

Failing that, you could write one in about half an hour!

Brittneybrittni answered 28/2, 2012 at 16:37 Comment(0)
B
15

Command-line options for viewing Plist files:

  • For viewing only: Use plutil -p, which prints the content of a property-list in JSON-like format (the format is meant for human consumption only).

Example (append | open -tf to view output in a text editor):

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

Example:

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

Caveat: If the plist has properties containing binary data, PlistBuddy will include it in raw form (by contrast, non-binary properties in the same file are printed properly). If XML output is desired, add option -x.

Note that PlistBuddy:

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

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

Bashan answered 9/4, 2013 at 16:23 Comment(0)
S
4

The standalone "Property List Editor" is gone since Xcode 4, you can use Pref Setter which is free but last updated 4 years ago.

To save the contents without the 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];
Snapback answered 28/2, 2012 at 17:3 Comment(0)
E
3

You can use visual studio code to open and edit Plist files. Just need to install an extension in the visual studio code called Binary Plist:

Binary Plist

Publisher: David Nicolson

Marketplace Link: https://marketplace.visualstudio.com/items?itemName=dnicolson.binary-plist

Extern answered 25/9, 2020 at 13:26 Comment(0)
P
1

There is a way to get the old Property List Editor working on Mac OS X Lion, if you don't want to use bloated XCode 4 for this.

Padnag answered 11/3, 2012 at 23:54 Comment(0)
B
0

There is a "Property List Editor" app as part of OS X (or there used to be, I'm away from my machine at the moment so can't check).

Failing that, you could write one in about half an hour!

Brittneybrittni answered 28/2, 2012 at 16:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.