在 macOS 發佈 Qt 程式

本篇 ShengYu 要介紹如何在 macOS 發佈 Qt 程式,如果你在 macOS 下開發的程式,想要到別人電腦裡可以正常執行起來的話,可以使用 qt 附帶的 macdeployqt 小工具,幫助你複製一些執行期間依賴的 qt 函式庫,

Qt macOS 發佈執行要用特殊小程式,輸出會是一個 dmg 檔案

1
~/Qt5.10.0/5.10.0/clang_64/bin/macdeployqt MyApp.app -dmg

或者不用 dmg 形式

1
~/Qt5.10.0/5.10.0/clang_64/bin/macdeployqt MyApp.app

其他參考
https://doc.qt.io/qt-5/macos-deployment.html