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

accessibilitycatalinacommand linemacosprivacy

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)?

Best Answer

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.

Related Question