Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Deployment on macOS
Forum Updated to NodeBB v4.3 + New Features

Deployment on macOS

Scheduled Pinned Locked Moved Solved Installation and Deployment
10 Posts 5 Posters 1.8k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MortyMarsM Offline
    MortyMarsM Offline
    MortyMars
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • MortyMarsM MortyMars

      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.

      M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      @MortyMars
      https://doc.qt.io/qt-6/macos-deployment.html#the-mac-deployment-tool

      macdeployqt 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

      MortyMarsM 1 Reply Last reply
      2
      • M mpergand

        @MortyMars
        https://doc.qt.io/qt-6/macos-deployment.html#the-mac-deployment-tool

        macdeployqt 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

        MortyMarsM Offline
        MortyMarsM Offline
        MortyMars
        wrote on last edited by
        #3

        Hi @mpergand,

        I tattled a bit but I finally got it right: thanks for your help :-)

        I haven't got round to it yet, but which options do you think are the most common and the most useful?

        M S 2 Replies Last reply
        0
        • MortyMarsM MortyMars

          Hi @mpergand,

          I tattled a bit but I finally got it right: thanks for your help :-)

          I haven't got round to it yet, but which options do you think are the most common and the most useful?

          M Offline
          M Offline
          mpergand
          wrote on last edited by mpergand
          #4

          @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 -dmg

          That creates a dmg straightforward with no issue for me so far.

          Paul ColbyP 1 Reply Last reply
          2
          • M mpergand

            @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 -dmg

            That creates a dmg straightforward with no issue for me so far.

            Paul ColbyP Offline
            Paul ColbyP Offline
            Paul Colby
            wrote on last edited by
            #5

            @mpergand said in Deployment on macOS:

            macdeployqt yourappname.app -dmg

            Same. I often also like to add -verbose=2

            Cheers.

            MortyMarsM 1 Reply Last reply
            1
            • Paul ColbyP Paul Colby

              @mpergand said in Deployment on macOS:

              macdeployqt yourappname.app -dmg

              Same. I often also like to add -verbose=2

              Cheers.

              MortyMarsM Offline
              MortyMarsM Offline
              MortyMars
              wrote on last edited by
              #6

              @mpergand, @Paul-Colby

              Thank you to both of you for your answers !

              1 Reply Last reply
              0
              • MortyMarsM MortyMars has marked this topic as solved on
              • MortyMarsM MortyMars

                Hi @mpergand,

                I tattled a bit but I finally got it right: thanks for your help :-)

                I haven't got round to it yet, but which options do you think are the most common and the most useful?

                S Offline
                S Offline
                SimonSchroeder
                wrote on last edited by
                #7

                @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.

                MortyMarsM SGaistS 2 Replies Last reply
                2
                • S SimonSchroeder

                  @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.

                  MortyMarsM Offline
                  MortyMarsM Offline
                  MortyMars
                  wrote on last edited by
                  #8

                  @SimonSchroeder

                  Thanks for your reply and for sharing your script.
                  I'll try to adapt it for my own application.

                  1 Reply Last reply
                  0
                  • S SimonSchroeder

                    @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.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @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.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 Reply Last reply
                    1
                    • SGaistS SGaist

                      @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.

                      S Offline
                      S Offline
                      SimonSchroeder
                      wrote on last edited by
                      #10

                      @SGaist In my case the source folder is the one generated by just compiling. So far, it only contains a single executable. Symbolic links would have to be adapted anyways to not point outside the AppImage we are creating.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved