Is it possible to give/remove permissions to/from apps via the command line?

Logi Options seems to forget it has Input Monitoring and Accessibility permissions frequently, so I have to go in and remove the permissions and add them back to get the scroll wheel on my MX Anywhere 2s mouse to work again. I'd like to automate that process. Is there some way to interact with the Catalina permissions via the command line (via sudo of course)?


The short answer is no - these are designed by Apple to be user granted, at the last moment, when you decide you wish to cede control to an app as opposed to pre-cleared and scripted. The better fix is to sort out why that App keeps changing or your OS is dropping the entitlements - you should be able to set it once.

It’s pretty easy to read the database to see what settings have been configured, not designed to change the settings directly via shell. (If you find a way, it might be worth $$ to report that to Apple - https://developer.apple.com/security-bounty/)

A longer answer is, kind-of - if you have MDM, and set up a framework, supervise the device (or opt in to the MDM automating these settings) and then craft configuration profiles that once signed and trusted, can be installed by script.

To get started on this takes quite a bit of time. Here’s a 30+ minute video that covers the basics and two pretty substantial web pages by Apple documenting the overall ideas and sample implementations.

  • https://www.jamf.com/resources/videos/a-rose-by-any-other-name-pppc-tcc-user-data-protection-and-you/ (The slide notes are very good to skim before you watch the video)
  • https://support.apple.com/en-ca/guide/mdm/mdmbf9e668/web
  • https://support.apple.com/guide/deployment-reference-macos/welcome/web (for reference once you’ve gotten the majority of the items in the previous two links sorted out)