Deployment on macOS
-
Hi everyone,
I'd like to start releasing an alpha version of an application to test how it works on computers other than my own.
But I have to admit that I don't quite understand how I should go about it, as everything I've read so far seems very complicated and far too unautomated.
I should point out that I'm using macOS.So thanks to those who develop on this platform for their advice and ways of doing things.
-
@MortyMars
https://doc.qt.io/qt-6/macos-deployment.html#the-mac-deployment-toolmacdeployqt is located at
for Qt6 in Qt6.3/6.3.2/macos/bin
for Qt5 in Qt5.15.2/5.15.2/clang_64/bin -
@MortyMars said in Deployment on macOS:
which options do you think are the most common and the most useful?
I'm using :
macdeployqt yourappname.app -dmgThat creates a dmg straightforward with no issue for me so far.
-
@mpergand said in Deployment on macOS:
macdeployqt yourappname.app -dmg
Same. I often also like to add
-verbose=2
Cheers.
-
Thank you to both of you for your answers !
-
M MortyMars has marked this topic as solved on
-
@MortyMars said in Deployment on macOS:
I haven't got round to it yet, but which options do you think are the most common and the most useful?
We found it necessary to do a few steps on macOS in order to get everything working. The last step is to make the .dmg a little nicer. Here is the script we are using:
#!/bin/bash echo Delete old application folder. rm -rf MyApp.app echo Copy new application folder. cp -r ../release/MyApp.app ./ install_name_tool -change /usr/local/lib/libomp.dylib @rpath/libomp.dylib MyApp.app/Contents/MacOS/MyApp mkdir -p MyApp.app/Contents/Frameworks cp libomp.dylib MyApp.app/Contents/Frameworks/ cp ../../3rdparty/lib3rdparty.dylib MyApp.app/Contents/Frameworks/ echo Bundle Qt libs. /full/path/to/macdeployqt MyApp.app echo Package examples. cp -r examples MyApp.app/Contents/Resources/ echo Create dmg. rm MyApp.dmg bin/create-dmg --volname "MyApp Installer" --background ../src/rc/mac_dmg_background.png --window-pos 200 120 --window-size 598 465 --icon-size 80 --icon MyApp.app 150 330 --hide-extension "MyApp.app" --app-drop-link 450 330 MyApp.dmg MyApp.app echo Done.
You see some extra steps that are necessary in our case. For libomp we need to change the rpath, we need to add some dynamic libraries by hand, and we also package some exampled.
The mac_dmg_background.png has our company logo and two transparent boxes where the app icon and the link to the application folder go. Between these two is an arrow suggesting to move the app to the application folder (for installation). There is an additional mac_dmg_background@2x.png for Retina displays in the same folder.
-
Thanks for your reply and for sharing your script.
I'll try to adapt it for my own application. -
@SimonSchroeder if memory serves well, when dealing with symbolic links,
cp -r
will end with a full copy of the targeted file which will increase your final binary size. You might want to check for that.