Solution
Successfully tested on
- Monterey 12.2.1
- BigSur 11.7.4
- Ventura 13.3, 13.6
- (See the bottom of the answer for other versions)
Make a backup copy of the TCC database, just in case:
cp ~/Library/Application\ Support/com.apple.TCC/TCC.db ~/TCC.db.bak
I opened the TCC database by running:
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db
I added the app by typing:
insert into access
values
('kTCCServiceMicrophone','<AppBundleURLname>', 0, 2, 2, 1, null, null, null, 'UNUSED', null, null, 1669648527);
Close the connection to the database:
.quit
The value to replace the placeholder <AppBundleURLname> in Step 3 above can be found by opening and inspecting file:
/Applications/appname.app/Contents/Info.plist
And usually it is the value keys like CFBundleURLName or CFBundleIdentifier. For example, for the WhatsApp MacOS app, if you open file:
/Applications/WhatsApp.app/Contents/Info.plist
then you will find something like:
<key>CFBundleURLName</key>
<string>com.WhatsApp.chat</string>
and it means that in this case you should replace <AppBundleURLname> with com.WhatsApp.chat in Step 3 of the above instructions.
For example
Note: The last value in the inserted record (see step 3) is just a timestamp (in seconds), you can put a timestamp that corresponds to any date you want, for example to check what date corresponds to timestamp 1669648527 you can type:
$ date --date='@1669648527'
Mon 28 Nov 15:15:27 GMT 2022
If you are running a different MacOS version
In this case, the structure of the access table may be different and the record you insert may be a bit different. You can inspect its structure with the following commands:
To compare the record you want to add with other existing records:
select * from access ;
Or perhaps even better:
select * from access where service = 'kTCCServiceMicrophone' ;
To check the structure (e.g. the columns) of the access table:
.schema access
Example with MacOS Sonoma
insert into access values ('kTCCServiceMicrophone','<AppBundleURLname>', 0, 2, 2, 1, null, null, null, 'UNUSED', null, null, 1669648527,null,null,'UNUSED',1669648527);
note that there are 4 additional columns, for more info see:
https://www.reluctant-tech-traveler.net/prod/user/showblog/macos-adding-apps-to-camera-mic-access-1