How do I skip verification of a .dmg file?
I have downloaded a dmg file but when I click on it it keeps verifying.
I've also tried to go to /System/Library/CoreServices/Installer.app
but I can't click on the .dmg because it is greyed out.
How can I open it?
Solution 1:
The command line tools allow you to mount the DMG and skip verification.
Open Terminal:
hdiutil attach -noverify /Path/To/Your/DMGFile.dmg
If you have the DMG file on your Desktop, and the DMG was named "Broken.DMG" you could type in something like this:
hdiutil attach -noverify ~/Desktop/Broken.dmg
Rather than typing the name of the file, just drop the file icon in the terminal window once the main command is ready. If your image is bad, the warning is correct and you should get a new dmg rather than bypass the error checking step.
A more global change would use defaults, but this check is very handy in general since it flags bad images:
defaults write com.apple.frameworks.diskimages skip-verify TRUE
This will stop the verification of DMG files permanently. After you've managed to skip the verification and open that file, it would be a good idea to re-enable the verification by opening Terminal again and typing in:
defaults write com.apple.frameworks.diskimages skip-verify FALSE
Solution 2:
The verification is used to make sure the .dmg
package is not corrupted. You had better wait for the verification to be done, since the likely situation is that your file is bad, not that the check can’t run.
If you really wanna skip the verification, execute the following commands in the Terminal,
# Disable the "Are you sure you want to open this application?" dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable Disk Image Verification: Verifying ...
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
To reverse the settings,
defaults delete com.apple.LaunchServices LSQuarantine -bool false
defaults delete com.apple.frameworks.diskimages skip-verify
defaults delete com.apple.frameworks.diskimages skip-verify-locked
defaults delete com.apple.frameworks.diskimages skip-verify-remote
References
- Disable open diaglog
- Awesome macOS Command Line
Solution 3:
FastDMG
FastDMG is a free app available from https://sveinbjorn.org/fastdmg which I have used for this for a long time.¹ It’s very convenient, and if the .dmg is corrupted, it won’t mount, so that will be the sign that something might be wrong. Also, if FastDMG does fail to mount a .dmg for some reason, it will offer to send it to the default macOS Disk Image Mounter.
¹ Because this is the Internet, allow me to add: “YMMV. Use at your own risk. No warranty expressed or implied.”
Features (copied from the current web page)
- Doesn’t waste your precious time verifying disk images
- Auto-accepts annoying end-user license agreements
- Runs in the background (doesn’t show up in the Dock)
- Displays no windows or menus and stays out of your way
- Multithreaded, can concurrently mount several images
- Disk image document icons continue to look the same
- Handles all disk image types supported by DiskImageMounter (dmg, iso, toast, etc.)
- FastDMG is actually a minimal wrapper around the
hdiutil
command-line tool that ships with macOS and therefore uses Apple’s private DiskImages framework indirectly.
(I’ll also add: you can set it to be the default app to open .dmg files, or you can just select a .dmg file in Finder and do: right-click » Open With » FastDMG for some DMGs if you with.)
The app is free with donations requested if you find the app useful.
Download
Download from https://sveinbjorn.org/files/software/FastDMG.zip