如何安装命令行DMG文件? [英] How do I install a DMG file from the command line?

查看:135
本文介绍了如何安装命令行DMG文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要找小bash或者python脚本将安装在的.dmg 文件。

I am looking for small bash or python script that will install a .dmg file.

我们将假设的伤害包含具有被复制到 /应用程序的一个或多个的.app <​​/ code>目录,覆盖任何已经存在的目录。

We'll assume that the dmg contains one or more .app directories that have to be copied to /Applications, overriding any already existing directories.

不匹配 *应用程序特征码文件或目录被忽略。

Files or directories not matching the *.app pattern are to be ignored.

推荐答案

您可以通过挂载磁盘映像

You can mount the disk image using

hdiutil attach -mountpoint <path-to-desired-mountpoint> <filename.dmg>

磁盘映像将在选定的路径安装(以下参数 -mountpoint )。然后,搜索一个的.app <​​/ code>文件,将文件复制到 /应用程序

一旦您完成安装卸载磁盘映像:

Once you have finished installation unmount the disk image:

hdiutil detach <path-to-mountpoint>

这篇关于如何安装命令行DMG文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆