Questions tagged [hdiutil]
18 questions
5
votes
3 answers
Error creating disk image using hdutil
I'm trying to build dmg of .app file using following hdutil command:
hdiutil create -srcfolder /Users/me/My.app My.dmg
It works as expected as it creates My.dmg correctly. Problem started happening when I add two more files in to .app bundle…

Nilay Anand
- 330
- 4
- 17
2
votes
3 answers
C++ interface for hdiutil on Mac
Does a system call or library exist that would allow my C++ code to use hdiutil on Mac OS X. My code needs to mount an available .dmg file and then manipulate what's inside.

theactiveactor
- 7,314
- 15
- 52
- 60
2
votes
1 answer
AppleScript throwing error on hdiutil command
I have the following code in an AppleScript file, which should mount a sparsebundle hosted on my network. Running this script throws an error on the hdiutil command:
try
mount volume "smb://192.168.1.1/sda2"
end try
do shell script "hdiutil…

alkalinecoffee
- 1,003
- 8
- 20
1
vote
1 answer
How to add software license terms to a Disk Image on macOS 11.0 Big Sur without the hdiutil flatten and unflatten verbs
On Mac, I am trying to add software license terms to a disk image file which the user will have to agree to before mounting the disk image. I used to be able to do this using the hdituil's flatten and unflatten verbs along with Rez (similar to how…

jmohrmann
- 21
- 3
1
vote
1 answer
-pubkey option in hdiutil
I have written a shell script that creates an encrypted sparsebundle disk image. I want to add a pubkey to the sparsebundle, but the option -pubkey (which is documented by Apple) is getting rejected when I add it to the shell script, or even when I…

sofly
- 233
- 7
- 12
1
vote
0 answers
The `appdmg` tool fails quite often in Mac OSX 10.15
I am using appdmg https://www.npmjs.com/package/appdmg to create dmg.
In OSX 10.15 it is failing quite often, I get the following error
Error: Command failed: hdiutil detach /Volumes/MyAppName
hdiutil: couldn't unmount "disk2" - Resource busy
What…

Anoop Vaidya
- 46,283
- 15
- 111
- 140
1
vote
1 answer
Programmatically hiding many files when creating hybrid iso with hdiutil
I'm trying to script the creation of a hyrbid (iso/joliet/hfs) iso with hdiutil. I can, for example, build an iso that hides things on the mac side like so:
hdiutil makehybrid -o foo.iso -hfs -joliet -iso -hide-hfs "{foo/bar.txt,foo/other.rtf}"…

jimjkelly
- 1,631
- 14
- 15
1
vote
1 answer
hdiutil: create failed - error -5342
I could successfully use hdiutil for creating a dmg file on my local El Capitan box, but it's failed with on OS X 10.9.5 of Travis CI with the error
hdiutil: create failed - error -5342
The command used to creating image is
hdiutil create -ov…

Quanlong
- 24,028
- 16
- 69
- 79
1
vote
3 answers
Calculating hdiutil's compression ratio
In my app I'm using Apple's hdiutil command line utility to create compressed disk images (DMGs) of folders/volumes. Is there any way to calculate the compressed size of a given source path? I've already checked in the man pages, nothing there.

indragie
- 18,002
- 16
- 95
- 164
1
vote
2 answers
Pipe a password from echo to hdiutil with objective-c
I´m struggling to learn obj-C and could use some help. I´m writing a "command line tool" to create a encrypted DMG and then safely delete the included files. When hdiutil creates the DMG it asks for a password for the encryption and I´m trying to…

Kalle
- 452
- 2
- 4
- 19
0
votes
2 answers
Issue with curl downloading corrupt DMG images
I'm trying to create an automated way to download multiple applications and install them, and I seem to be having trouble at the first hurdle. I am able to download and install .pkg files with no issue, but when it comes to .dmg files I'm getting an…

joe
- 1
0
votes
1 answer
Mounting a loop device on macOS in C
How do you mount a loop device (similar to hdiutil attach) on XNU / Darwin in C?
Specifically I'm looking for functionality that would be in linux/loop.h, but on XNU. ( I'm going to be doing this on iOS, don't ask ;) )

spv
- 46
- 1
0
votes
0 answers
Using Process to Create a DMG with hdiutil
I'm having a play with Process() and trying to get it to create a DMG on my Desktop.
The code I'm trying is:
func terminal(_ args:String...) -> integer_t{
print(args)
let task = Process()
let dataPipe = Pipe()
let errPipe = Pipe()
task.launchPath…

Chris Barrett
- 571
- 4
- 23
0
votes
1 answer
how to properly use hdutils to create a DMG on a (Travis) OSX VM
Hello I have a script that creates a MacOSX image and then copies stuff to it.
The script was tested and worked fine until I tried to implement it in a Travis build.
This is where things get interesting. The bit of code that is of interest is as…

Gabriella Turek
- 137
- 10
0
votes
1 answer
Can I modify a disk image while it is open, but not "save changes"?
I have a script where I create a disk image of an SD card using hdiutil and then mount that disk image. I then write extended attributes to the files inside using xattr and important them into a program. Is there any way I can reverse those xattr…

arlovande
- 81
- 1
- 8