1

I am developing an application that needs System Events as well as access to individual apps through AppleScript. When I access an application for the first time, it will trigger a dialog asking for permission.

However, if I disable the setting it will simply fail, but not re-trigger that dialog. This is not a real issue, except that I built an onboarding flow that will prepare the user for the upcoming dialog and then (should) trigger the dialog, so the first time user can enable this setting fully understanding what it's purpose.

There is no way for me to test the "new user" scenario, as I don't have any way to completely reset these settings. I have no idea if the dialog would really trigger for a new user unless I start with a completely new machine.

I did try tccutil, but it seems to be buggy and/or abandoned. I needed to install Python 2.7 to make it work and then most commands gleaned from the internet like tccutil reset All com.myapp.MyApp are not recognized (tccutil: error: unrecognized arguments: All com.myapp.MyApp). There are also quite a few warnings about the tool not working and even partially bricking the OS in terms of permissions, so I'm not sure I should persist.

I tried removing all instances of the application and restarting the machine. It will still list the application in Automation.

How can I completely reset these permissions so they will be asked again on the same OS install as if I was running Automation on a given application from my application for the first?

2
  • 1
    Not sure but this might need to be moved to stack overflow.com as it is a programming question (somewhat, not sure). Have you tried creating a new test user that you only use once for this particular purpose? Also virtualizing macOS has gotten a whole lot easier these days. Have you tried this in a VM that you can discard the changes on once you test your app? Jan 14 at 22:24
  • Thanks @SteveChambers. While I encountered the issue while programming, it's more an OS level issue. Also, all people that were dealing with the same problem were trying to reset Mic access for Zoom and stuff like that. So I assume more people have knowledge about these issues here. Jan 15 at 7:33

1 Answer 1

1

Apple's version of tccutil is /usr/bin/tccutil, other versions may be installed elsewhere. It sounds like you have installed a different version that uses Python. Either uninstall the other version, or use Apple's version by full path.

To reset the ability to control apps by sending AppleEvents, use /usr/bin/tccutil reset AppleEvents [bundle-ID]. To reset the ability to control apps by sending low-level events like keystrokes and clicks, use /usr/bin/tccutil reset Accessibility [bundle-ID].

7
  • It seemed strange to me too, but this went away as soon as I installed Python 2.7: lucas@Lucass-MBP SwiftBenchmarks % tccutil reset ClockAssist env: python: No such file or directory Jan 15 at 7:31
  • I'll try reset AppleEvents Jan 15 at 7:32
  • @LucasvanDongen I wonder if you could be using a third-party version of tccutil, github.com/jacobsalmela/tccutil, rather than Apple's tccutil? What does the command which tccutil show you?
    – JWWalker
    Jan 15 at 23:01
  • It's /usr/local/bin/tccutil. Looks like it came from Brew: brew list tccutil yields /usr/local/Cellar/tccutil/1.2.6/bin/tccutil. I assume exploits don't typically install stuff through Brew?....don't remember installing this at all.... Jan 16 at 8:09
  • 1
    @LucasvanDongen I have updated my answer.
    – JWWalker
    Jan 17 at 23:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .