Why do I need it?
The Team ID, Bundle ID, and/or code requirement are important pieces of information for creating PPPC, system extension, or KEXT payloads. This allows you to whitelist certain applications (Bundle ID) or application developers (Team ID). Using this information, you will find how to acquire this information to implement as you wish.
Finding the Team ID or Bundle ID via Terminal
- Open the Terminal app on the Mac (Applications/Utilities/Terminal.app)
- In a new Terminal window, type codesign -dv [PATH OF APPLICATION] (In the example below, we're using the Skitch app). Press Enter.
- For the Team ID, find the text starting with "TeamIdentifier=" (see image below)
- For the Bundle ID, find the text starting with "Identifier=" (see image below)
Be sure to only copy the text after the = sign. In this case, it would be com.google.Chrome and EQHXZ8M8AV
Finding the Code Requirement via Terminal
- Open the Terminal app on the Mac (Applications/Utilities/Terminal.app)
- In a new window, type codesign -dr - [PATH OF APPLICATION] (the example below uses the Skitch app). Press Enter.
- Find the text starting with "designated =>" (this is the Code Requirement, highlighted in the image below)
Finding the Team ID, Bundle ID, and Code Requirement via Script
The script below can be used to obtain the Team ID, Bundle ID, and Code Requirement without having to manually perform each command. The script requires the path of the application to be inserted into line 2: APP_PATH="/Applications/APPLICATION_NAME.app".
#!/bin/bash
APP_PATH="/Applications/APPLICATION_NAME.app"
echo "Code Requirement: $(codesign -dr - "$APP_PATH" 2>&1 | grep "designated" | head -1 | sed -n 's/^.*designated =>//p')"
echo "##########################################################"
echo "Team ID: $(codesign -dv "$APP_PATH" 2>&1 | grep "TeamIdentifier" | head -1 | sed -n 's/^.*TeamIdentifier=//p')" && echo "Bundle ID: $(codesign -dv "$APP_PATH" 2>&1 | grep "Identifier" | head -1 | sed -n 's/^.*Identifier=//p')"
echo "##########################################################"
echo "Executable: $(codesign -dr - "$APP_PATH" 2>&1 | grep "Executable" | head -1 | sed -n 's/^.*Executable=//p')"
Using Google Chrome as an example the output would look like this:
Alternative Method (Requires macOS Ventura)
Use the following command:
sudo sfltool dumpbtm
It will output many items, so it would be best to implement a grep or perform a CMD + F search for the item you are looking for.
Here is the output for the Team ID and Bundle ID using Skitch as an example: