Home > Enterprise >  Re-request permission on macOS
Re-request permission on macOS

Time:10-11

I'm writing an application in SwiftUI for iOS and macOS. The app requires permissions to access the calendar.

I managed to get the macOS app to request the permission by adding calendar access to the entitlements file and the Privacy - Calendars Usage Description value in the info.plist, but I had a bug in my code and would like to re-request the permission. However, the app is now in the security settings for the Calendar and while I can add/remove the permission there, I can not delete the app from the list.

I tried cleaning up the build folder and then, yes, the app is gone from the security settings, but when I re-run the app, I'm not asked for permission again, but the last state is restored.

What's the easiest way for me to start over and make my app request the permission again as if it was run freshly for the first time?

CodePudding user response:

Privacy permissions can be modified using the tccutil command line tool. For example, you can run the following to reset all permissions for your app:

tccutil reset All com.mycompany.myapp

(replacing the bundle identifier with one that matches your app)

  • Related