2 Replies
      Latest reply on Aug 15, 2019 1:00 AM by eskimo
      Rulovic Level 1 Level 1 (0 points)

        Hello all,

        Having this scenario:

        I have sh script running as daemon which controls .app. Basically it makes sure that application is always running.

        The .app needs to have accessibility permissions so inside it I show popup asking user to enable accessibility and opening the accessibility panel in order to give the .app permissions.

        My problem is in the list displayed in accessibility preferences it appears the .sh with its icon and not my .app with the icon I have added to it.

        So I have two questions:
        Is possible to change the icon to .sh script?
        Why is OSX asking to give accessibility permissions to the script instead of the .app?

        Thanks in advance

        • Re: Change icon to sh script
          john daniel Level 3 Level 3 (450 points)

          Maybe change the launchd script to run the app directly. There are options to keep the app running.

          • Re: Change icon to sh script
            eskimo Apple Staff Apple Staff (12,045 points)

            I have sh script running as daemon which controls [an] .app.

            Running as a daemon?  Or running as an agent?

            The former is going to be problematic because daemons run in a global context and apps run within a GUI login session.  Creating a daemon that reaches up out of its global context into a GUI login session generally doesn’t end well.  To start, you have to answer the question “Which GUI login session?” because there can be more than one.

            Before continuing I recommend that you read Technote 2083 Daemons and Agents.  It’s old, and a little crufty, but it’s core explanation of the macOS architecture is still valid, and you need to understand that if you’re going to make any progress here.

            Share and Enjoy

            Quinn “The Eskimo!”
            Apple Developer Relations, Developer Technical Support, Core OS/Hardware
            let myEmail = "eskimo" + "1" + "@apple.com"