{"id":1483,"date":"2016-01-27T12:44:24","date_gmt":"2016-01-27T09:44:24","guid":{"rendered":"http:\/\/hxml.me\/blog\/?p=1483"},"modified":"2016-01-27T12:44:24","modified_gmt":"2016-01-27T09:44:24","slug":"preobrazovat-dvoichnyj-plist-v-xml","status":"publish","type":"post","link":"https:\/\/hxml.me\/blog\/coding\/preobrazovat-dvoichnyj-plist-v-xml\/","title":{"rendered":"<!--:en-->Convert binary plist to XML<!--:--><!--:ru-->\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 plist \u0432 XML<!--:-->"},"content":{"rendered":"<p><!--:en--><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft\" src=\"http:\/\/hxml.me\/img\/post\/nb.png\" alt=\"\" width=\"114\" height=\"114\" \/><br \/>\nFrom time to time there I face a problem how to convert the plist file from binary representation back to XML. This problem usually occurs when you need to extract project plist file from IPA archive and see what&#8217;s inside. This is complicated by the fact that the IPA builder (xcrun utility) compresses everything possible to reduce the size of the application, and probably this accelerates application launch. So after I painfully searched the solution for fifth time I&#8217;ve decided to store it to my blog.<br \/>\n<!--:--><br \/>\n<!--:ru--><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft\" src=\"http:\/\/hxml.me\/img\/post\/nb.png\" alt=\"\" width=\"114\" height=\"114\" \/> \u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 <strong>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c plist<\/strong> \u0444\u0430\u0439\u043b \u0438\u0437 <strong>\u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e<\/strong> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 <strong>XML<\/strong>. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0437 IPA \u0430\u0440\u0445\u0438\u0432\u0430 \u0438\u0437\u0432\u043b\u0435\u0447\u044c plist \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438. \u042d\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a <strong>IPA<\/strong> (\u0443\u0442\u0438\u043b\u0438\u0442\u0430 xcrun) \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u044d\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0420\u0435\u0448\u0438\u043b \u0440\u0430\u0437 \u043d\u0430 \u043f\u044f\u0442\u044b\u0439 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0441\u043a\u0438\u043d\u0443\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u0431\u043b\u043e\u0433, \u0447\u0442\u043e\u0431 \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043c\u0443\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e.<!--:--><br \/>\n<!--more--> <\/p>\n<p><!--:en--><br \/>\nYou can make it easy with plutil command line tool which is the part of Xcode development kit.<\/p>\n<pre lang=\"bash\">plutil -convert xml1 some_file.plist<\/pre>\n<p>And maybe you will ever need back conversion from XML to binary:<\/p>\n<pre lang=\"bash\">plutil -convert binary1 some_other_file.plist<\/pre>\n<p>Caution! this will overwrite source file. If you need to keep it, use -o option to store result in different path<\/p>\n<pre lang=\"bash\">plutil -convert xml1 some_file.plist -o result.plist<\/pre>\n<p><!--:--><\/p>\n<p><!--:ru--><br \/>\n\u0410 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b plutil, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 Xcode.<\/p>\n<p><strong>\u0418\u0437 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0432 XML<\/strong>:<\/p>\n<pre lang=\"bash\">plutil -convert xml1 some_file.plist<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f,<strong> \u0438\u0437 XML \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439<\/strong>:<\/p>\n<pre lang=\"bash\">plutil -convert binary1 some_other_file.plist<\/pre>\n<p>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043e\u043f\u0446\u0438\u044e -o<\/p>\n<pre lang=\"bash\">plutil -convert xml1 some_file.plist -o result.plist<\/pre>\n<p><!--:--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From time to time there I face a problem how to convert the plist file from binary representation back to XML. This problem usually occurs when you need to extract project plist file from IPA archive and see what&#8217;s inside. This is complicated by the fact that the IPA builder (xcrun utility) compresses everything possible [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,47],"tags":[137,136,134,135,139,138],"class_list":["post-1483","post","type-post","status-publish","format-standard","hentry","category-apple","category-coding","tag-binary","tag-convert","tag-nota-bene","tag-plist","tag-xcode","tag-xml"],"_links":{"self":[{"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/posts\/1483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/comments?post=1483"}],"version-history":[{"count":5,"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/posts\/1483\/revisions"}],"predecessor-version":[{"id":1488,"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/posts\/1483\/revisions\/1488"}],"wp:attachment":[{"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/media?parent=1483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/categories?post=1483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hxml.me\/blog\/wp-json\/wp\/v2\/tags?post=1483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}