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. macOS mojave privacy prompt not appearing when debugging audio app in Qt Creator

macOS mojave privacy prompt not appearing when debugging audio app in Qt Creator

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 2.7k Views
  • 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
    mjsmithers
    wrote on last edited by mjsmithers
    #1

    Hi,

    macOS mojave has security privacy restrictions for many new things including accessing the microphone. See System Preferences -> Security and Privacy -> Privacy

    Unfortunately unless an app is ok'd to access the microphone, audio input on ALL soundcards and sound interfaces is muted (silence) for the app. I'm guessing only signed apps trigger the user prompt to allow audio input access, but this presents a problem when developing and debugging apps in Qt Creator. My audio apps have silence on input!!!

    Has anyone figured out how to debug apps that need to trigger the new mojave privacy prompts? Is there a way to register Qt Creator as an ok app for microphone access? (Assuming that debugged apps inherit Qt Creator's permissions...)

    Command line audio apps work fine since the macOS Terminal can be registered for access to the microphone.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Pretty good question I would recommend posting it on the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

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

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mjsmithers
        wrote on last edited by mjsmithers
        #3

        Ok, here's how I got debugging working. (I haven't got release builds working yet.)

        • Start QT Creator
        • Load the audio project
        • In the audio project's Info.plist file add two lines
          <key>NSMicrophoneUsageDescription</key>
          <string>(Some description of the audio processing)</string>
        • Compile and start debugging the app. This triggers the mojave security prompt.

        Note that the security prompt seems to use the app name from the following Info.plist field to register the app.
        <key>CFBundleIdentifier</key>
        <string>Company Name.Application Name</string>
        If this is changed, the prompt will reappear the next time the app is debugged.

        1 Reply Last reply
        2
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What you can do is:

          1. build your application
          2. copy the generate Info.plist file in your project sources
          3. Modify the file to contain that additional key
          4. Add QMAKE_INFO_PLIST = $$PWD/Info.plist to your .pro file

          See QMAKE_INFO_PLIST documentation for more details.

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

          M 1 Reply Last reply
          2
          • SGaistS SGaist

            What you can do is:

            1. build your application
            2. copy the generate Info.plist file in your project sources
            3. Modify the file to contain that additional key
            4. Add QMAKE_INFO_PLIST = $$PWD/Info.plist to your .pro file

            See QMAKE_INFO_PLIST documentation for more details.

            M Offline
            M Offline
            mjsmithers
            wrote on last edited by mjsmithers
            #5

            @SGaist Yes, the Info.plist file is already in place in the resources as you describe. The questions are around how exactly to trigger the mojave security prompt.

            For debugging, the method in my message above seems to work. For Release builds, I suspect the app also needs to be signed (which I definitely can do but just haven't tested yet).

            UPDATE: The same Info.plist lines work for the Release build, without the app signed.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @mjsmithers said in macOS mojave privacy prompt not appearing when debugging audio app in Qt Creator:

              UPDATE: The same Info.plist lines work for the Release build, without the app signed.

              Great !

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

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Morfio
                wrote on last edited by
                #7

                Hi,

                if I run in QtCreator only the debug version (without using debug mode) the system does not ask for microphone access. I can only access the microphone if I start debugging or sign my app with macdeployqt.

                Is there a way to turn this features off?

                Thank you

                Morfio

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Morfio Hi, that's something Apple implemented, you have to go to the system settings in order to allow an application access. However, you should rather do as @mjsmithers did and add the field in the Info.plist file.

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

                  1 Reply Last reply
                  1
                  • J Offline
                    J Offline
                    Joshua Parmenter
                    wrote on last edited by
                    #9

                    Hi everyone - to come back a BIT to this topic, I have my Info.plist key / values set., and also in Release mode with the application I work on not signed, I get the prompt and mic input. However - after signing and notarizing through Apple, the microphone does NOT work and I don't get a prompt. I've cleared out Security settings, etc., but it doesn't seem like this gets triggered with the signed version. I start again with the unsigned, and things will work again.
                    Has anyone else seen anything similar and ... any luck with a solution?
                    Thanks!

                    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