8000 GitHub - jreitzersmith/tccutil: (OS X) Command line tool to add and remove items from (TCC.db) the Accessibility database
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jreitzersmith/tccutil

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

tccutil.py

tccutil.py logo

Modify OS X's Accessiblity Database from the Command Line

Apple has a utility in /usr/bin named tccutil, but it only supports one command, which is to reset the entire database. I wanted a command-line utility that would be able to add, remove, list, and take other actions.

How is tccutil.py Different?

tccutil.py can just be installed to /usr/sbin without any additional software.

It can then be run just like any other command line tool. I also wanted the syntax to be easy to remember without having to look it up in the help menu.

There are other solutions out there, but there were some things I did not like about them:

Usage

This utility needs super-user priveleges for most operations.

It is important that you either run this as root or use sudo, otherwise it won't work and you will end up with “permission denied” errors.

Usage:
  tccutil.py [--help]
  sudo tccutil.py [--list]
  sudo tccutil.py [--insert | --remove | --enable | --disable] [<bundle_id | cli_path>] [--verbose]

  tccutil.py reset <service> (pass through to OS X's built-in command)

    <service> names: [ Accessibility | AddressBook | Calendar | CoreLocationAgent |Facebook | Reminders | Twitter]

Options:
  -h | --help      Displays this Help Menu.
  -l | --list      Lists all Entries in the Accessibility Database.
  -i | --insert    Adds the given Bundle ID or Path to the Accessibility Database.
  -r | --remove    Removes the given Bundle ID or Path from the Accessibility Database.
  -e | --enable    Enables Accessibility Access for the given Bundle ID or Path.
  -d | --disable   Disables Accessibility Access for the given Bundle ID or Path.
  -v | --verbose   Outputs additional info for some commands.

Examples

List existing Entries in the Accessibility Database

sudo tccutil.py --list

Add /usr/bin/osascript to the Accessibility Database (using UNIX-Style Option)

sudo tccutil.py -i /usr/bin/osascript

Add Script Editor to the Accessibility Database (using Long Option)

sudo tccutil.py --insert com.apple.ScriptEditor2

Remove Terminal from the Accessibility Database

sudo tccutil.py --remove com.apple.Terminal

Enable Terminal (must already exist in the Database)

sudo tccutil.py --enable com.apple.Terminal

Disable /usr/bin/osascript (must already exist in the Database)

sudo tccutil.py -d /usr/bin/osascript

Current Feature Set

  1. List existing Entries in Accessibility Database
  2. Insert new Item into Accessibility Database (even Command-Line Utilities)
  3. Remove an existing Item from the Accessibility Database
  4. Enable or disable an Entry

Planned Features

  1. Modify other parts of the TCC.db.

About

(OS X) Command line tool to add and remove items from (TCC.db) the Accessibility database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%
0