{"id":625,"date":"2026-01-20T20:54:00","date_gmt":"2026-01-20T12:54:00","guid":{"rendered":"https:\/\/blog.bexonbai.com\/?p=625"},"modified":"2026-04-24T11:56:39","modified_gmt":"2026-04-24T03:56:39","slug":"mac-%e4%bd%bf%e7%94%a8-create-dmg-%e8%a3%bd%e4%bd%9c-dmg-%e6%98%a0%e8%b1%a1%e5%ae%89%e8%a3%9d%e5%8c%85","status":"publish","type":"post","link":"https:\/\/blog.bexonbai.com\/?p=625","title":{"rendered":"Mac \u4f7f\u7528 create-dmg \u88fd\u4f5c dmg \u6620\u8c61\u5b89\u88dd\u5305"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/create-dmg\/create-dmg\">create-dmg<\/a>\u00a0\u662f\u4e00\u500b\u7528\u65bc\u69cb\u5efa\u7cbe\u7f8e dmg \u6620\u8c61\u7684 shell \u6307\u4ee4\u78bc\u3002\u76ee\u524d\u5927\u591a\u6578\u958b\u767c\u8005\uff0c\u5305\u62ec Apple \u5b98\u65b9\uff0c\u90fd\u5728\u4f7f\u7528 dmg \u6620\u8c61\u4f86\u5206\u767c Mac App\uff0c\u672c\u6587\u5c07\u4f7f\u7528 create-dmg \u4f86\u88fd\u4f5c\u4e00\u500b app \u5206\u767c\u6620\u8c61\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6e96\u5099\">\u51c6\u5907<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5 create-dmg\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u901a\u8fc7 Homebrew<code> brew install create-dmg<\/code><\/li>\n\n\n\n<li>\u901a\u8fc7 Github \u5b98\u65b9\u4ed3\u5e93 <a href=\"https:\/\/github.com\/create-dmg\/create-dmg\">https:\/\/github.com\/create-dmg\/create-dmg<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5efa\u7acb-dmg-\u6a94\u6848\">\u521b\u5efa dmg \u6587\u4ef6<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u65f6\u4f60\u9700\u8981\u51c6\u5907\u597d\u4f60\u7684 app \u548c\u4e00\u5f20\u5f15\u5bfc\u62d6\u62fd\u7684\u80cc\u666f\u56fe\uff08\u6587\u4e2d\u63d0\u4f9b\u4e86\u4e00\u5f20\u6211\u51c6\u5907\u597d\u7684\uff09\uff0c\u6587\u4ef6\u76ee\u5f55\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NewEmptyFolder\n - MacApp.app\n - backgroung.svg<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u80cc\u666f\u5716\">\u80cc\u666f\u56fe<\/h3>\n\n\n\n<svg id=\"dmg-svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 660 400\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" xml:space=\"preserve\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;\">\n    <filter id=\"shadow_filter\">\n        <feDropShadow dx=\"4\" dy=\"4\" stdDeviation=\"2\" flood-color=\"gray\" flood-opacity=\"0.2\"><\/feDropShadow>\n    <\/filter>\n    <path d=\"M592.5,127.251l0,106.5c0,29.389 -23.861,53.25 -53.25,53.25l-417.5,0c-29.389,0 -53.25,-23.861 -53.25,-53.25l0,-106.5c0,-29.389 23.861,-53.25 53.25,-53.25l417.5,0c29.389,0 53.25,23.861 53.25,53.25Z\" style=\"fill:#fff;\" filter=\"url(#shadow_filter)\"><\/path>\n    <path d=\"M344.971,177.475l-23.993,-22.494c-1.316,-1.234 -3.237,-1.234 -4.554,0l-0.396,0.372c-1.684,1.579 -1.684,4.471 0,6.05l17.145,16.073c1.684,1.579 1.684,4.471 0,6.05l-17.143,16.073c-1.685,1.579 -1.685,4.471 0,6.05l0.395,0.372c1.316,1.234 3.237,1.234 4.554,0l23.993,-22.494c1.685,-1.579 1.685,-4.471 0,-6.05l-0.001,-0.002Z\" style=\"fill:#6c6c6c;\"><\/path>\n<\/svg>\n\n\n\n<p><button id=\"download-svg-btn\" style=\"padding: 10px 20px; background-color: #0066cc; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 14px;\" class=\"openCC-text\">\u4e0b\u8f7d SVG<\/button><\/p>\n\n<script>\ndocument.getElementById('download-svg-btn').addEventListener('click', function() {\n    const svgElement = document.getElementById('dmg-svg');\n    const svgString = new XMLSerializer().serializeToString(svgElement);\n    const blob = new Blob([svgString], { type: 'image\/svg+xml' });\n    const url = URL.createObjectURL(blob);\n    const link = document.createElement('a');\n    link.href = url;\n    link.download = 'background.svg';\n    document.body.appendChild(link);\n    link.click();\n    document.body.removeChild(link);\n    URL.revokeObjectURL(url);\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fdb\u5165\u6587\u4ef6\u5939\u6240\u5728\u7684\u76ee\u5f55\u6253\u5f00 Terminal\u3002\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create-dmg \\\n  --volname \"Application Installer\" \\\n  --background \"background.svg\" \\\n  --window-pos 400 200 \\\n  --window-size 660 400 \\\n  --icon-size 100 \\\n  --icon \"Application.app\" 160 160 \\\n  --hide-extension \"Application.app\" \\\n  --app-drop-link 500 160 \\\n  \"Application.dmg\" \\\n  \"Application.app\/\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53cc\u51fb\u6253\u5f00 Application.dmg<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"512\" src=\"https:\/\/blog.bexonbai.com\/wp-content\/uploads\/2026\/04\/image-1.png\" alt=\"\" class=\"wp-image-627\" srcset=\"https:\/\/blog.bexonbai.com\/wp-content\/uploads\/2026\/04\/image-1.png 772w, https:\/\/blog.bexonbai.com\/wp-content\/uploads\/2026\/04\/image-1-300x199.png 300w, https:\/\/blog.bexonbai.com\/wp-content\/uploads\/2026\/04\/image-1-768x509.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u6709\u51c6\u5907<code>icns<\/code>\u56fe\u6807\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u955c\u50cf\u7684\u56fe\u6807\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  --volicon \"AppIcon.icns\" \\<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"91\" height=\"117\" src=\"https:\/\/blog.bexonbai.com\/wp-content\/uploads\/2026\/04\/image.png\" alt=\"\" class=\"wp-image-626\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>create-dmg\u00a0\u662f\u4e00\u500b\u7528\u65bc\u69cb\u5efa\u7cbe\u7f8e dmg \u6620\u8c61\u7684 shell \u6307\u4ee4\u78bc\u3002\u76ee\u524d\u5927\u591a\u6578\u958b\u767c\u8005\uff0c\u5305\u62ec Appl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-625","post","type-post","status-publish","format-standard","hentry","category-develop"],"_links":{"self":[{"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=\/wp\/v2\/posts\/625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=625"}],"version-history":[{"count":1,"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=\/wp\/v2\/posts\/625\/revisions"}],"predecessor-version":[{"id":628,"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=\/wp\/v2\/posts\/625\/revisions\/628"}],"wp:attachment":[{"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bexonbai.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}