Skip to content

Instantly share code, notes, and snippets.

@bistole
Created March 3, 2021 03:30
Show Gist options
  • Save bistole/30cb68b25eefd3303d2441fc60b7f0fa to your computer and use it in GitHub Desktop.
Save bistole/30cb68b25eefd3303d2441fc60b7f0fa to your computer and use it in GitHub Desktop.
build dmg
# mount dmg
echo "Mount DMG..."
hdiutil attach ${TEMP_DMG_FILE} | tee ${LOG_FILE0}
DMG_UUID=`grep /Volumes/untitled ${LOG_FILE0} | awk '{print $2}'`
echo DMG UUID = ${DMG_UUID}
# rename dmg
echo "Rename DMG's olume name"
diskutil rename untitled Storyboard
# copy app to dmg
echo "Copy files into DMG..."
cp -Rf $APP_FILE /Volumes/Storyboard
ln -s /Applications /Volumes/Storyboard
# detach
echo "Unmount DMG..."
hdiutil detach /Volumes/Storyboard
# convert
echo "Convert DMG to readonly..."
hdiutil convert -format UDBZ -o ${DMG_FILE} ${TEMP_DMG_FILE}
# cleanup
rm -f ${TEMP_DMG_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment