How do I check Xcode's version from the command line?
I want to be able to check the version number from scripts or remotely via SSH.
Open your Xcode up, head to the menu bar and select Xcode > About Xcode.
We'll use Finder to find out if XCode is installed. In Finder, select the Go pull-down menu, and select Applications. Or just use the short-cut key Command-Shift-A while Finder is active. This should open a new Finder window, showing all the Applications installed on your machine.
Start Xcode on the Mac. Choose Preferences from the Xcode menu. In the General window, click the Locations tab. On the Location window, check that the Command Line Tools option shows the Xcode version (with which the Command Line Tools were installed).
Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. It was initially released in late 2003; the latest stable release is version 13.4. 1, released on June 2, 2022, via the Mac App Store with macOS Monterey.
$ system_profiler SPDeveloperToolsDataType
Developer:
Developer Tools:
Version: 6.1.1 (6A2008a)
Location: /Applications/Xcode.app
Applications:
Xcode: 6.1.1 (6611)
Instruments: 6.1 (56160)
SDKs:
OS X:
10.10: (14A382)
10.9: (13F26)
iOS:
8.1: (12B411)
iOS Simulator:
7.1: (11D167)
8.1: (12B411)
also check out xcrun
man page (man xcrun
) and xcode-select
along with xcodebuild
from the other answer.
For mac users, running the below from the terminal will work:
$ xcodebuild -version
Xcode 11.3.1
Build version 11C505
additionally, the exit code is standard 0
for success and 1
if CommandLineTools is configured instead of Xcode
% xcodebuild -version ; echo "# exit code: $?"
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
# exit code: 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With