Find out app identifier (usually a reverse DNS string) for "defaults" command

I would like to disable hold and press for Hyper Terminal. I have already successfully done so for VS Code using the following recipe:

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

from https://stackoverflow.com/a/44010683/7483211

My problem is that I don't know the app identifier I need to put in instead of com.microsoft.VSCode.

How do I find this out for an app?


Solution 1:

It's actually not called an "app identifier" (that's something slightly different) - the correct name is "bundle identifier".

You can find it by looking in the Info.plist file in the Contents folder of any macOS application. For example for Visual Studio Code, it would typically be located in:

/Applications/Visual Studio Code.app/Contents/Info.plist

You need to look for the key named CFBundleIdentifier - it will look something like this:

<key>CFBundleIdentifier</key>
<string>com.microsoft.VSCode</string>

Solution 2:

I figured out one way by going through defaults help:

defaults read | grep hyper

This outputs:

   "co.zeit.hyper" =     {
                "bundle-id" = "co.zeit.hyper";

So in my case the answer is co.zeit.hyper.

There may be a better way, but this works if you can guess part of the app name correctly.