Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Please specify path to macOS Install application."
exit 1
fi
installer_path="$1"
#echo "attach ${installer_path}"
hdiutil attach -noverify -quiet "${installer_path}/Contents/SharedSupport/SharedSupport.dmg"
xml_path="/Volumes/Shared Support/com_apple_MobileAsset_MacSoftwareUpdate/com_apple_MobileAsset_MacSoftwareUpdate.xml"
os_version=$(/usr/libexec/PlistBuddy -c "Print :Assets:0:OSVersion" "$xml_path")
build=$(/usr/libexec/PlistBuddy -c "Print :Assets:0:Build" "$xml_path")
echo "OS Version: ${os_version} (${build})"
#echo "detach ${1}"
hdiutil detach -quiet "/Volumes/Shared Support"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment