Aller au contenu
uencoder

Convertir Apple plist files to JSON

Apple propriété lists (plist) serialize données en XML ou binary formater. Convertir en JSON pour cross-platform utiliser et easier manipulation.

  1. 1

    Apple plist files come in two formats: XML (human-readable, older) and binary (compact, modern). They store configuration for macOS and iOS apps — Info.plist, preferences, entitlements. The XML format uses specific tags: <dict>, <array>, <string>, <integer>, <true/>, <false/>.

  2. 2
    Formateur XML →

    Formater the XML plist to verify structure. Plist XML has a strict schema: <plist version="1.0"> root with a single <dict> or <array>. Format to catch malformed XML and verify the plist structure.

  3. 3
    Convertisseur JSON ↔ XML →

    Convertir the XML plist to JSON. The plist's <dict> becomes a JSON object (keys are <key> elements, values are the following element), <array> becomes a JSON array, and primitive types map en their JSON equivalents

  4. 4

    Binary plists must be decoded first (plutil -convert xml1 file.plist on macOS). For cross-platform projects, convert plists to JSON at build time and generate plists from JSON for Xcode. This enables version control diffs (binary plists are not diff-friendly) and cross-platform tooling.

Questions fréquentes

XML or binary plist?
Binary is more compact and faster to read/write. XML is human-readable and version-control-friendly. For development, use XML (better diffs). For distribution, convert to binary. Xcode can use either — it converts automatically.
Can JSON represent everything a plist can?
Almost. Plist supports NSDate (date), NSData (binary), and NSNull. JSON has no date or binary type — encode dates as ISO 8601 strings and binary as base64. Use a wrapper format if you need exact plist fidelity.

Workflows résolvant cette tâche

Outils associés