Skip to main content
Solved

Xcode Command Line Tools Version


Forum|alt.badge.img+4
  • Contributor
  • 18 replies

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.

 

Best answer by sdagley

@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>"
View original
Did this topic help you find an answer to your question?

2 replies

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3536 replies
  • Answer
  • October 21, 2023

@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>"

Forum|alt.badge.img+4
  • Author
  • Contributor
  • 18 replies
  • October 23, 2023
sdagley wrote:

@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>"

Thank you!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings