之前有介绍过 利用 keta.app 压缩工具来制作dmg安装文件

MacOS 利用keka.app压缩工具制作dmg文件_wxgnolux的博客-CSDN博客keak 压缩工具可以直接将目录制作成dmg文件。只需要把目录拖放到 keka 就可以轻松实现,目录里可以做一个Application的链接这样就可以利用dmg来分发开发好的macos 的 app了。为了更简化操作,还可以写成sh脚本。# 建一个用来破app的目录mkdir target# 将app复制进目录mv test.app target#将在目录下建Application 链接ln -s /Applications target/Applicationhttps://gnolux.blog.csdn.net/article/details/124891477这次再介绍用 create-dmg 开源脚本,相对而言更加适合脚本的方式使用。

下面是安装和使用说明。

直接 brew install create-dmg 就能安装。

xulong@xulongdeMac-mini ~ % brew install create-dmg
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/create-dmg-1.0.10.a
#=#=#
curl: (22) The requested URL returned error: 404 

使用例子

rm -rf  *.c *.so build/
#dist目录下的  工资条帮.app  打包为 wxWorkHelper_setup.dmg
test -f dist/wxWorkHelper_setup.dmg  && rm -f wxWorkHelper_setup.dmg
create-dmg --volname 工资条帮 \--window-pos 200 120 \--window-size 800 400 \--volicon appicon.icns \--icon-size 100 \--icon 工资条帮.app 200 190 \--hide-extension 工资条帮.app \--app-drop-link  600 185 \dist/wxWorkHelper_setup.dmg \dist/工资条帮.app

打包完成dmg后,打开dmg就能安装了。

create-dmg

A shell script to build fancy DMGs.

Status and contribution policy

Create-dmg is mostly maintained by @aonez and the contributors who send pull requests. The project home page is GitHub - create-dmg/create-dmg: A shell script to build fancy DMGs.

We will merge any pull request that adds something useful and does not break existing things.

If you're an active user and want to be a maintainer, or just want to chat, please ping us on Gitter at gitter.im/create-dmg/Lobby, or email Andrew directly.

Create-dmg was originally created by Andrey Tarantsov. In May 2020 Andrew Janke helped vastly with the project.

Installation

  • You can install this script using Homebrew:

    brew install create-dmg
  • You can download the latest release and install it from there:

    make install
  • You can also clone the entire repository and run it locally from there:

    git clone https://github.com/create-dmg/create-dmg.git

Usage

create-dmg [options ...] <output_name.dmg> <source_folder>

All contents of source_folder will be copied into the disk image.

Options:

  • --volname <name>: set volume name (displayed in the Finder sidebar and window title)
  • --volicon <icon.icns>: set volume icon
  • --background <pic.png>: set folder background image (provide png, gif, jpg)
  • --window-pos <x> <y>: set position the folder window
  • --window-size <width> <height>: set size of the folder window
  • --text-size <text_size>: set window text size (10-16)
  • --icon-size <icon_size>: set window icons size (up to 128)
  • --icon <file_name> <x> <y>: set position of the file's icon
  • --hide-extension <file_name>: hide the extension of file
  • --custom-icon <file_name|custom_icon|sample_file> <x> <y>: set position and -tom icon
  • --app-drop-link <x> <y>: make a drop link to Applications, at location x, y
  • --ql-drop-link <x> <y>: make a drop link to /Library/QuickLook, at location x, y
  • --eula <eula_file>: attach a license file to the dmg
  • --rez <rez_path>: specify custom path to Rez tool used to include license file
  • --no-internet-enable: disable automatic mount&copy
  • --format: specify the final image format (UDZO|UDBZ|ULFO|ULMO) (default is UDZO)
  • --add-file <target_name> <file|folder> <x> <y>: add additional file or folder (can be used multiple times)
  • --disk-image-size <x>: set the disk image size manually to x MB
  • --hdiutil-verbose: execute hdiutil in verbose mode
  • --hdiutil-quiet: execute hdiutil in quiet mode
  • --bless: bless the mount folder (deprecated, needs macOS 12.2.1 or older, #127)
  • --codesign <signature>: codesign the disk image with the specified signature
  • --notarize <credentials>: notarize the disk image (waits and staples) with the keychain stored credentials For more information check Apple's documentation
  • --skip-jenkins: skip Finder-prettifying AppleScript, useful in Sandbox and non-GUI environments, #72
  • --sandbox-safe: hdiutil with sandbox compatibility, do not bless and do not execute the cosmetic AppleScript
  • --version: show tool version number
  • -h, --help: display the help

Example

#!/bin/sh
test -f Application-Installer.dmg && rm Application-Installer.dmg
create-dmg \--volname "Application Installer" \--volicon "application_icon.icns" \--background "installer_background.png" \--window-pos 200 120 \--window-size 800 400 \--icon-size 100 \--icon "Application.app" 200 190 \--hide-extension "Application.app" \--app-drop-link 600 185 \"Application-Installer.dmg" \"source_folder/"

See the examples folder in the source tree for more examples.

GitHub - create-dmg/create-dmg: A shell script to build fancy DMGs

MacOS APP 打包成 dmg - 使用 create-dmg相关推荐

  1. 将 app 打包成 deb 发布安装

    一般在发布越狱应用都会打包成 deb 格式,通过下面的方法可以打包并安装. 一.准备文件 新建一个目录 debtest,在 debtest 目录下新建 DEBIAN 和 Applications 这两 ...

  2. [iOS]如何把App打包成ipa文件,然后App上架流程[利用Application Loader]

    在上一篇博客已经讲过上传项目了,但是有的时候,需要我们进行打包成ipa包到别的手机上跑(但是前提是,这个手机的UDID必须绑定到对应的开发者账号中,也就是证书也得是从同样的开发者账号申请下来的才可以) ...

  3. [iOS]把App打包成ipa文件,然后App上架流程[利用Application Loader]

    假设你现在已经完成了证书,Bundle Identifier 和描述文件的配置 然后配置工程 打开你项目工程 第一步,这里不能选择模拟器,选择iOS Device 如果不支持横屏,把这2个勾去掉 然后 ...

  4. 越狱后如何使用将.app打包成deb程序

    准备工具 1.一台mac 2.一个xxxx.app包,注意 使用Any iOS Device(arm64)方式编译 3.dkpg命令 4.codesign命令 5.一个entitlements.pli ...

  5. qt 开发的 macos app 上线 appstore

    qt 开发的macos app使用已经快一年了,由于客户要求app上线appstore,因为没用做过,一脸懵逼,不知从何下手,技术群问问技术大佬,也都是三言两语,虽然有人做过,但是人家大佬根本不想鸟你 ...

  6. 将uniapp打包成h5放在安卓webview中(解决uniapp引入第三方地图卡顿问题)

    本来是使用uniapp进行开发,然后打包成安卓软件的,因为是用了地图模块(基于天地图),因为uniapp框架的限制,只能使用webview组件引入地图文件,然后出现一个问题,发现地图在浏览器中打开很流 ...

  7. electron项目打包成dmg

    1.通过脚手架搭建的项目 官方文档有很详细的教程: electron-forge https://github.com/electron-userland/electron-forge 我采用的如下命 ...

  8. 软件分享:将应用一键打包成dmg文件

    简介 苹果软件开发完成后,都要打包成dmg文件.通常的做法也许是到系统自带的磁盘工具里制作dmg文件,但这样做比较繁琐,尤其是要打包多个应用时,每次只能制作一个dmg文件很麻烦.分享一个很好用很方便的 ...

  9. 设置网页打开默认全屏_网页打包成APP,macOS解锁刷少数派新姿势

    随着web端所能实现的功能.体验越来越完善,是否需要客户端成为网站管理者重新考虑的问题,尤其是对于一些资讯类信息流网站.例如少数派,移动端和桌面端网站的自适应做的非常完善,拥有iOS/Android双 ...

最新文章

  1. STM32 基础系列教程 38 - Lwip_http
  2. 数字图像处理:第十章 离散图象变换
  3. 周例会会议、汇报框架
  4. Linux系统检测工具 三(Free,Top,ps,Vmstat,Sysstat)
  5. 【最近公共祖先】[COCI]STOGOVI
  6. 设计模式---3(工厂方法模式的概念,工厂方法模式的实现,工厂方法模式和简单工厂模式比较)
  7. PKM(个人知识管理)类软件收集(偶尔更新列表)
  8. 阿里千万实例可观测采集器-iLogtail正式开源
  9. 【转】windows 7系统安装与配置Tomcat服务器环境
  10. 问一个AddDevice和设备符号链的问题??
  11. PHP二开美化版站长技术导航网站源码
  12. 面试官系统精讲Java源码及大厂真题 - 19 LinkedBlockingQueue 源码解析
  13. Matlab中fixdt数据类型
  14. 多语言界面 Web 站点的几个 Tip
  15. python用什么来写模块-Python常用模块——模块介绍与导入
  16. 添加源ubuntu_x64 安装 Adobe Reader
  17. Android历史与版本变迁
  18. 黑客入侵电脑网络四大步骤
  19. 什么是广域网和局域网?
  20. 一篇文章带你入门python基础开发

热门文章

  1. 5个实用的性能测试工具(软件测试工程师必备)
  2. 0x00000090 - 该内存不能read written
  3. webstrom主题、字体设置
  4. 大数据技术有哪些,为什么说云计算能力是大数据的根本!
  5. Kettle学习之记录集连接
  6. 移动游戏性能测试工具
  7. 芯片验证自学,IC验证自学入门教程:ASIC芯片设计流程讲解
  8. Winform四边阴影
  9. 智能化软件开发沙龙优秀学者报告·第1期PPT分享(张天翼 普渡大学)
  10. MySQL 时间函数加减计算