{"id":1149,"date":"2014-10-25T16:28:19","date_gmt":"2014-10-25T07:28:19","guid":{"rendered":"https:\/\/ecoop.net\/memo\/?p=1149"},"modified":"2014-10-25T16:40:03","modified_gmt":"2014-10-25T07:40:03","slug":"convert_plist_to_or_from_json","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/convert_plist_to_or_from_json.html","title":{"rendered":"plist \u3068 json \u3092\u76f8\u4e92\u5909\u63db\u3059\u308b"},"content":{"rendered":"<p>iOS\u3084Mac OS X\u3067\u4f7f\u7528\u3055\u308c\u308bplist\u5f62\u5f0f(\u30d7\u30ed\u30d1\u30c6\u30a3\u30ea\u30b9\u30c8)\u3068\u3001<br \/>\nAndroid\u3084web\u30b7\u30b9\u30c6\u30e0\u3067\u4f7f\u3044\u3084\u3059\u3044JSON\u306b\u76f8\u4e92\u5909\u63db\u3057\u305f\u3044\u5834\u5408\u306e\u30e1\u30e2\u3002<br \/>\n<!--more--><br \/>\nMac OS X\u3092\u4f7f\u3063\u3066\u3044\u308b\u306a\u3089\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089plutil\u30b3\u30de\u30f3\u30c9\u3067\u7c21\u5358\u306b\u76f8\u4e92\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>Info.plist\u306a\u3069\u3001.plist\u30d5\u30a1\u30a4\u30eb\u3092json\u5f62\u5f0f\u306b\u5909\u63db\u3057\u305f\u3044\u5834\u5408<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">plutil -convert json input.plist -r -o output.json<\/pre>\n<p>input.plist\u306f\u5909\u63db\u5143\u30d5\u30a1\u30a4\u30eb\u540d\u3001output.json\u306f\u4fdd\u5b58\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3066\u4e0b\u3055\u3044\u3002<br \/>\n-r \u30aa\u30d7\u30b7\u30e7\u30f3\u306fJSON\u3092\u6574\u5f62\u3057\u3066\u51fa\u529b\u3059\u308b\u305f\u3081\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u7121\u304f\u3066\u3082\u52d5\u4f5c\u3057\u307e\u3059\u3002<br \/>\n-o \u30aa\u30d7\u30b7\u30e7\u30f3(\u51fa\u529b\u5148\u6307\u5b9a)\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u3001\u5909\u63db\u5143\u30d5\u30a1\u30a4\u30eb(input.plist)\u3092\u4e0a\u66f8\u304d\u3059\u308b\u306e\u3067\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>JSON\u30d5\u30a1\u30a4\u30eb\u3092plist\u5f62\u5f0f\u306b\u5909\u63db\u3057\u305f\u3044\u5834\u5408<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">plutil -convert json input.json -o output.plist<\/pre>\n<p>input.json\u306f\u5909\u63db\u5143\u30d5\u30a1\u30a4\u30eb\u540d\u3001output.plist\u306f\u4fdd\u5b58\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3066\u4e0b\u3055\u3044\u3002<br \/>\nplist\u304b\u3089json\u306e\u5909\u63db\u3068\u540c\u69d8\u3001-o \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u3001-r\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305f\u5909\u63db\u5143\u30d5\u30a1\u30a4\u30eb\u3092\u4e0a\u66f8\u304d\u3059\u308b\u306e\u3067\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>plutil \u306e\u8a73\u3057\u3044\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u306f man plutil(\u4e0b\u8a18)\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPLUTIL(1)                 BSD General Commands Manual                PLUTIL(1)\r\n\r\nNAME\r\n     plutil -- property list utility\r\n\r\nSYNOPSIS\r\n     plutil &#x5B;command_option] &#x5B;other_options] file\r\n             ...\r\n\r\nDESCRIPTION\r\n     plutil can be used to check the syntax of property list files, or convert\r\n     a plist file from one format to another.  Specifying - as an input file\r\n     reads from stdin.\r\n\r\n     The first argument indicates the operation to perform, one of:\r\n\r\n     -help         Show the usage information for the command and exit.\r\n\r\n     -p            Print the property list in a human-readable fashion. The\r\n                   output format is not stable and not designed for machine\r\n                   parsing. The purpose of this command is to be able to eas-\r\n                   ily read the contents of a plist file, no matter what for-\r\n                   mat it is in.\r\n\r\n     -lint         Check the named property list files for syntax errors.\r\n                   This is the default command option if none is specified.\r\n\r\n     -convert fmt  Convert the named file to the indicated format and write\r\n                   back to the file system.  If the file can&#039;t be loaded due\r\n                   to invalid syntax, the operation fails.\r\n\r\n                   fmt is one of:  xml1, for version 1 of the XML plist format\r\n                                   binary1, for version 1 of the binary plist\r\n                                   format json, for the JSON format\r\n\r\n     There are a few additional options:\r\n\r\n     --            Specifies that all further arguments are file names\r\n\r\n     -s            Don&#039;t print anything on success.\r\n\r\n     -r            For JSON, add whitespace and indentation to make the output\r\n                   more human-readable.\r\n\r\n     -o path       Specify an alternate path name for the result of the -con-\r\n                   vert operation; this option is only useful with a single\r\n                   file to be converted.  Specifying - as the path outputs to\r\n                   stdout.\r\n\r\n     -e extension  Specify an alternate extension for converted files, and the\r\n                   output file names are otherwise the same.\r\n\r\nDIAGNOSTICS\r\n     The plutil command exits 0 on success, and 1 on failure.\r\n\r\nSEE ALSO\r\n     plist(5)\r\n\r\nSTANDARDS\r\n     The plutil command obeys no one&#039;s rules but its own.\r\n\r\nHISTORY\r\n     The plutil command first appeared in Mac OS X 10.2.\r\n\r\nMac OS X                        August 30, 2002                       Mac OS X\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>iOS\u3084Mac OS X\u3067\u4f7f\u7528\u3055\u308c\u308bplist\u5f62\u5f0f(\u30d7\u30ed\u30d1\u30c6\u30a3\u30ea\u30b9\u30c8)\u3068\u3001 Android\u3084web\u30b7\u30b9\u30c6\u30e0\u3067\u4f7f\u3044\u3084\u3059\u3044JSON\u306b\u76f8\u4e92\u5909\u63db\u3057\u305f\u3044\u5834\u5408\u306e\u30e1\u30e2\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,101],"tags":[],"class_list":["post-1149","post","type-post","status-publish","format-standard","hentry","category-ios-dev","category-mac-2"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/1149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=1149"}],"version-history":[{"count":1,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/1149\/revisions"}],"predecessor-version":[{"id":1150,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/1149\/revisions\/1150"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=1149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=1149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=1149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}