Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to sign Qt application for MacOS
Forum Updated to NodeBB v4.3 + New Features

How to sign Qt application for MacOS

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 2.2k Views 1 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.
  • D Offline
    D Offline
    dporobic
    wrote on 16 Dec 2020, 09:53 last edited by
    #1

    We have an application that is build with CMake and we have automated build system that builds the packages for us, for different OS, including MacOS.

    Recently, our users on MacOS started seeing "cannot open because the developer cannot be verified". Our understanding is that the application needs to be signed and for that we need an Apple Developer Account, is that correct? We don't intend to distribute the application via AppStore, just via HomeBrew and dmg download.

    Does anyone know how to sign a MacOS application on TravisCI?

    Is there any support for OpenSource non profit applications from Apple?

    https://github.com/ksnip/ksnip

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 16 Dec 2020, 12:39 last edited by
      #2

      On new macs, notarization is required. You can do it using macdeployqt (but with new Qt like 5.15): https://doc.qt.io/qt-5/macos-deployment.html#the-mac-deployment-tool

      That means you need the developer account, yes.

      Users can still enable "untrusted" apps in system settings, and open your unsigned app this way.

      Does anyone know how to sign a MacOS application on TravisCI?

      You can use macdeployqt from the command line, so also within Travis.

      (Z(:^

      D 1 Reply Last reply 16 Dec 2020, 13:51
      2
      • D Offline
        D Offline
        dporobic
        wrote on 16 Dec 2020, 12:51 last edited by
        #3

        Thanks for the feedback. Fortunately we already use macdeployqt for packaging on TravisCI. I'll give it a try.

        https://github.com/ksnip/ksnip

        1 Reply Last reply
        0
        • S sierdzio
          16 Dec 2020, 12:39

          On new macs, notarization is required. You can do it using macdeployqt (but with new Qt like 5.15): https://doc.qt.io/qt-5/macos-deployment.html#the-mac-deployment-tool

          That means you need the developer account, yes.

          Users can still enable "untrusted" apps in system settings, and open your unsigned app this way.

          Does anyone know how to sign a MacOS application on TravisCI?

          You can use macdeployqt from the command line, so also within Travis.

          D Offline
          D Offline
          dporobic
          wrote on 16 Dec 2020, 13:51 last edited by dporobic
          #4

          @sierdzio One question though. If I understand correctly I can sign the package with -codesign, but what is the parameter for it? Whats the identity that the documentation refers to?

          https://github.com/ksnip/ksnip

          S 1 Reply Last reply 16 Dec 2020, 13:55
          0
          • D dporobic
            16 Dec 2020, 13:51

            @sierdzio One question though. If I understand correctly I can sign the package with -codesign, but what is the parameter for it? Whats the identity that the documentation refers to?

            S Offline
            S Offline
            sierdzio
            Moderators
            wrote on 16 Dec 2020, 13:55 last edited by sierdzio
            #5

            @dporobic said in How to sign Qt application for MacOS:

            @sierdzio One question though. If I understand correctly I can sign the package with -codesign, but what is the parameter for it?

            Your developer identity, taken from Apple Developer page. It's usually something like "Developer ID Application: Name Surname (ABC123AABB)" (it's a string).

            (Z(:^

            D 1 Reply Last reply 17 Dec 2020, 08:33
            1
            • S sierdzio
              16 Dec 2020, 13:55

              @dporobic said in How to sign Qt application for MacOS:

              @sierdzio One question though. If I understand correctly I can sign the package with -codesign, but what is the parameter for it?

              Your developer identity, taken from Apple Developer page. It's usually something like "Developer ID Application: Name Surname (ABC123AABB)" (it's a string).

              D Offline
              D Offline
              dporobic
              wrote on 17 Dec 2020, 08:33 last edited by
              #6

              @sierdzio Created the developer account and tried to use my Identity (the string that I see on the Apple Developer Account page) like this:

              macdeployqt packageDir/ksnip.app -codesign=${APPLE_IDENTITY}
              

              but I get following error:

              ERROR: Codesign signing error:
              ERROR: "error: The specified item could not be found in the keychain.\n"
              

              https://github.com/ksnip/ksnip

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sierdzio
                Moderators
                wrote on 17 Dec 2020, 09:26 last edited by
                #7

                Ah right, the key needs to be registered on the device which is doing the build. That can be a challenge on TravisCI... I don't know how to do it, sorry. Please search around.

                (Z(:^

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dporobic
                  wrote on 21 Dec 2020, 15:35 last edited by
                  #8

                  Just in case someone runs into this issue, here is explained how you can import a certificate on a headless CI: https://www.update.rocks/blog/osx-signing-with-travis/

                  https://github.com/ksnip/ksnip

                  1 Reply Last reply
                  0

                  1/8

                  16 Dec 2020, 09:53

                  • Login

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