1
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のインストールメディアを作る

Last updated at Posted at 2016-12-30

ShellScriptの練習も兼ねて。
参考:Mac OS X で起動可能なインストールディスクを作成する方法 | R WannaBeAdored

createInstallmedia.sh
# !/bin/sh
export INSTALLER_NAME='Install macOS Sierra.app'
echo input target volume...
read vol
export TARGET_VOLUME=${vol}

# TODO 勝手にOSイメージを検知できるようにするとうれしいよね
sudo "/Applications/${INSTALLER_NAME}/Contents/Resources/createinstallmedia" --volume "/Volumes/${TARGET_VOLUME}"

echo press any key...
read wait
exit

あらかじめフォーマットしたUSBディスクなり突っ込んでボリューム名を入力してください。
末尾にexitコマンド入れれば勝手に閉じるはず。
個人的には成否を確認したいので最後にread入れて止めてます。
macOSのパッケージ仕様が変わったら使えなくなるので注意。

2019/10/18 追記
Mojaveからオプション: applicationpathが非推奨となっていたので削除しました。(参考)

1
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
1
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?