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.
  • M Offline
    M Offline
    MortyMars
    wrote on 30 Apr 2024, 22:30 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 30 Apr 2024, 22:41
    0
    • M MortyMars
      30 Apr 2024, 22:30

      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 30 Apr 2024, 22:41 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

      M 1 Reply Last reply 1 May 2024, 00:31
      2
      • M mpergand
        30 Apr 2024, 22:41

        @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

        M Offline
        M Offline
        MortyMars
        wrote on 1 May 2024, 00:31 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 1 May 2024, 00:54
        0
        • M MortyMars
          1 May 2024, 00:31

          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 1 May 2024, 00:54 last edited by mpergand 5 Jan 2024, 00:56
          #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.

          P 1 Reply Last reply 1 May 2024, 02:13
          2
          • M mpergand
            1 May 2024, 00:54

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

            P Offline
            P Offline
            Paul Colby
            wrote on 1 May 2024, 02:13 last edited by
            #5

            @mpergand said in Deployment on macOS:

            macdeployqt yourappname.app -dmg

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

            Cheers.

            M 1 Reply Last reply 1 May 2024, 08:34
            1
            • P Paul Colby
              1 May 2024, 02:13

              @mpergand said in Deployment on macOS:

              macdeployqt yourappname.app -dmg

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

              Cheers.

              M Offline
              M Offline
              MortyMars
              wrote on 1 May 2024, 08:34 last edited by
              #6

              @mpergand, @Paul-Colby

              Thank you to both of you for your answers !

              1 Reply Last reply
              0
              • M MortyMars has marked this topic as solved on 1 May 2024, 08:34
              • M MortyMars
                1 May 2024, 00:31

                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 3 May 2024, 07:13 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.

                M SGaistS 2 Replies Last reply 3 May 2024, 12:44
                2
                • S SimonSchroeder
                  3 May 2024, 07:13

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

                  M Offline
                  M Offline
                  MortyMars
                  wrote on 3 May 2024, 12:44 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
                    3 May 2024, 07:13

                    @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 4 May 2024, 07:28 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 6 May 2024, 06:30
                    1
                    • SGaistS SGaist
                      4 May 2024, 07:28

                      @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 6 May 2024, 06:30 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

                      1/10

                      30 Apr 2024, 22:30

                      • Login

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