安装appdmg
npm install -g appdmg
使用
# json-path: Path to the JSON Specification file
# dmg-path: Path at which to place the final DMG
appdmg <json-path> <dmg-path>
# 示例
appdmg test/assets/appdmg.json ~/Desktop/test.dmg
JSON 输入文件格式
{
"title": "Test Application",
"icon": "test-app.icns",
"background": "test-background.png",
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "TestApp.app" }
]
}