跳到主要内容
uencoder

转换 Apple plist files to JSON

Apple 属性 lists (plist) 序列化数据在 XML 或二进制格式化. Convert 到 JSON 为 cross-平台 use 和 easier manipulation.

  1. 1

    Apple plist files come 在 two formats: XML (human-readable, older) 和二进制 (compact, 现代). 它们存储配置为 macOS 和 iOS apps — Info.plist, preferences, entitlements. XML 格式化我们特定 tags: <dict>, <数组>, <字符串>, <整数>, <真/>, <假/>.

  2. 2
    XML 格式化器 →

    格式化 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
    JSON 与 XML 互转器 →

    将 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 转换为 their JSON equivalents

  4. 4

    二进制 plists 必须是 decoded 第一 (plutil -转换 xml1 file.plist 开 macOS). 为 cross-平台 projects, 转换 plists 到 JSON 在构建时间和 生成 plists 从 JSON 为 Xcode. 此 enables version control diffs (二进制 plists 是不 差异比较-friendly) 和 cross-平台 tooling.

常见问题

XML 或二进制 plist?
二进制是 更多 compact 和 faster 到读取/写入. XML 是 human-readable 和 version-control-friendly. 为 development, use XML (better diffs). 为分布, 转换到 二进制. Xcode 能够 use 任一 — 它 converts automatically.
能够 JSON 表示一切 plist 能够?
Almost. Plist supports NSDate (日期), NSData (二进制), 和 NSNull. JSON 有否 日期或 二进制类型 — 编码 dates as ISO 8601 strings 和二进制 as base64. Use 包装器格式化如果你 need exact plist fidelity.

解决此任务的工作流

相关工具