Creating a .DMG

后端 未结 4 995
渐次进展
渐次进展 2020-12-23 10:44

I want to create a dmg file for my Mac project. Can someone please tell me how to do this? This being my first Mac project, I do not have any idea how to proceed. I also wan

4条回答
  •  太阳男子
    2020-12-23 11:10

    why don't you just run a script from your xcode project. try something like this:

    # be sure to check the man page for hdiutil
    # it is very powerful and has tons of options...
    
    hdiutil create -megabytes 54 -fs HFS+ -volname awesome_app_install myAwesomeApplication.dmg
    hdiutil mount myAwesomeApplication.dmg
    cp -r /build/Release/AwesomeApplication.app /Volumes/awesome_app_install/
    

    then save your script as something like 'makeDMG.sh' and in your target,

    select add->new build phase->run script build phase
    and drag your script into this build phase.

    once you've done all that, then when you build your project the script will create the disk image and copy your release build into it...

    of course you should spice your script to flavor... these three lines are just the raw meat

    ps: your custom EULA should get built into your packagemaker project (which you can also script very nicely)

提交回复
热议问题