macOS apps - How to find Bundle IDs

There are several common ways to find the Bundle ID / CFBundleIdentifier of a macOS app. We'll focus on utilizing the Apple onboard macOS software tools Terminal and Finder.
Terminal with osascript
You can find the Bundle ID of an application on a macOS system using the terminal and a command-line tool built into macOS called osascript.
How to find the app Bundle ID with the terminal and osascript:
Open Terminal.
Enter the following command:
osascript -e 'id of app "Application Name"'
Replace "Application Name" with the application name you're interested in. For example, if you want to find the Bundle ID for Safari, you will enter:
osascript -e 'id of app "Safari"'
- Press Enter. The Bundle ID of the application should appear.
This command asks AppleScript (via osascript) to get the Bundle ID of the specified application and works for both built-in applications like Safari and third-party applications.
Alternative or maybe an more advanced way is to read the info.plist file in an app.
The CFBundleIdentifier and CFBundleShortVersionString for a macOS application can be obtained from the <app_name>.app/Contents/Info.plist file.
Alternatively, these values may be queried directly via the macOS Terminal. For instance, the commands below return the bundle identifier and version number of Keka.




Comments