Posted on 10-20-2023 12:05 PM
I'm trying to create an extension attribute for the version of Xcode Command Line Tools that is installed on each machine.
The goal is to eventually have a patch policy to regularly update the versions as needed.
The closest I have found is this post, however the attribute seems to no longer work and I can't seem to find any documentation to gather the version of Command Line Tools.
If anyone has had any luck with this recently I would greatly appreciate any guidance.
Solved! Go to Solution.
Posted on 10-20-2023 08:48 PM
@lsv Here's an updated EA that returns the Command Line Tools version, or "Not Installed" if they're not installed:
#!/bin/sh
result="Not Installed"
CLIToolsVersion=$(pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version | cut -d ' ' -f 2)
if [ -n "$CLIToolsVersion" ]; then
result="$CLIToolsVersion"
fi
echo "<result>$result</result>"
Posted on 10-20-2023 08:48 PM
@lsv Here's an updated EA that returns the Command Line Tools version, or "Not Installed" if they're not installed:
#!/bin/sh
result="Not Installed"
CLIToolsVersion=$(pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version | cut -d ' ' -f 2)
if [ -n "$CLIToolsVersion" ]; then
result="$CLIToolsVersion"
fi
echo "<result>$result</result>"
Posted on 10-23-2023 02:11 PM
Thank you!