Sam Merrell

Managing app permissions in Gatekeeper on macOS from the command line


<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--> Warning: This no longer works in macOS Sequoia 15.3. You have to run the executable once then when it is denied, go to Settings > Privacy & Security, scroll down to the Security section which should list the app you just tried to run. From there you can allow the app.

I just recently updated my work laptop to Catalina, I’m running into many of my command line tools being banned from running due to Gatekeeper. You can fix this by running the command by right clicking in Finder and choosing “open” explicitly. That works fine for full apps, but it is a bit annoying for command line apps. For command line apps you can use the spctl tool.

  • spctl -a <path to the executable> will tell you if it is rejected or not
  • spctl --add --label <app label> <path to the executable> will allow the app to be run. Adding a label lets you enable or disable all apps under that same label

I tried looking at what spctl --list showed, but the output wasn’t readable.

Found the info from https://www.cnet.com/news/how-to-manage-os-x-gatekeeper-from-the-command-line/


Tags:

Like what you read? Subscribe to my feed.

Have some thoughts, comments, questions, noticed a typo? Send me an email or hit me up on Mastodon.