Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error creating disk image using hdutil

Tags:

macos

hdiutil

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 before calling that hdutil command. The hdutil ends up with error:

diskimages-helper: resize request is above maximum size allowed.
hdiutil: create failed - Invalid argument

Thanks for any help you can provide.

like image 368
Nilay Anand Avatar asked Sep 04 '13 18:09

Nilay Anand


2 Answers

I had the same problem. The solution I found at Apple Support Communities worked for me. I ended up adding an empty .Trash file into the folder before calling hdiutil:

touch root_folder/.Trash

or with Ant in my case:

<touch file="root_folder/.Trash"/>
like image 55
Michal Avatar answered Nov 16 '22 01:11

Michal


You can optionally specify a '-size' parameter when you invoke hdiutil. If you specify a size large enough that the disk image doesn't need to be resized during .dmg creation, it seems you can avoid this error.

E.g.:

hdiutil create -size 240m -fs HFS+ -srcfolder test -volname Test test.dmg
like image 2
pagej97 Avatar answered Nov 16 '22 01:11

pagej97