Qt Deploying on Mac


Qt offers a deployment tool for Mac: The Mac Deployment Tool.

The Mac deployment tool can be found in QTDIR/bin/macdeployqt. It is designed to automate the process of creating a deployable application bundle that contains the Qt libraries as private frameworks.

The mac deployment tool also deploys the Qt plugins, according to the following rules (unless -no-plugins option is used):

  • The platform plugin is always deployed.
  • Debug versions of the plugins are not deployed.
  • The designer plugins are not deployed.
  • The image format plugins are always deployed.
  • The print support plugin is always deployed.
  • SQL driver plugins are deployed if the application uses the Qt SQL module.
  • Script plugins are deployed if the application uses the Qt Script module.
  • The SVG icon plugin is deployed if the application uses the Qt SVG module.
  • The accessibility plugin is always deployed.

To include a 3rd party library in the application bundle, copy the library into the bundle manually, after the bundle is created.

To use macdeployqt tool you can open terminal and type:

$ QTDIR/bin/macdeployqt <path to app file generated by build>/appFile.app

The app file will now contain all the Qt Libraries used as private frameworks.

macdeployqt also supports the following options

-verbose=<0-3>0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug
-no-pluginsSkip plugin deployment
-dmgCreate a .dmg disk image
-no-stripDon't run 'strip' on the binaries
-use-debug-libsDeploy with debug versions of frameworks and plugins (implies -no-strip)
-executable=Let the given executable also use the deployed frameworks
-qmldir=Deploy imports used by .qml files in the given path

Detailed informations can be fount on Qt Documentation