2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macOSのターミナルにてdmgのappをインストール

Posted at

ちゃお・・・†

Homebrew Caskを利用するとmacOS用のGUIアプリケーションをターミナル上だけでインストールを完了することが出来ますが、Homebrew Caskは全てのアプリに対応しているわけではありません。そこでこの記事では、Homebrew Caskを利用せずにmacOS用のアプリをコマンドだけでインストールを完結させる方法を紹介します。なお、この記事ではdmg内のappファイルをコピーしてインストールする場合の方法のみ扱います。

dmg内のpkgファイルからインストールする方法はMacOS(OSX)でコマンドラインからdmgインストールをご覧ください。

実行環境


% sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.5
BuildVersion:	19F96

コマンド

例としてMacVim-KaoriYaをインストールする方法を紹介します。exportコマンドでの設定を変えることで他のアプリにも対応出来ます。

copy_app_from_dmg.sh

export BASENAME="MacVim-KaoriYa-20180324"
export URL=https://github.com/splhack/macvim-kaoriya/releases/download/20180324/${BASENAME}.dmg
export VOLUME="MacVim-KaoriYa 20180324"
export APPNAME="MacVim.app"
curl -L ${URL} > /tmp/${BASENAME}.dmg
hdiutil mount /tmp/${BASENAME}.dmg
cp -r /Volumes/${VOLUME}/${APPNAME} /Applications
hdiutil unmount "/Volumes/${VOLUME}/"
rm /tmp/${BASENAME}.dmg
unset BASENAME URL VOLUME APPNAME
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?