You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

xcodebuild thinks I have an old version of macos

My issue started when I installed system update and updated my macOS to 13.4.1.


when I run xcodebuild I get this message:

Executable requires at least macOS 12.0, but is being run on macOS 10.16, and so is exiting.


By the way, I have xcode version 14.3.1 (I can see it in "About XCode") but when I run "xcodebuild -version" I also get the error message from above.


What I tried:

  • Uninstalling and re-installing xcode and command line tools
  • Downgrading xcode to 14.3.0


Please let me know how I can fix it.

MacBook Pro 16″, macOS 13.4

Posted on Jul 10, 2023 3:51 AM

Reply
5 replies

Jul 10, 2023 9:16 AM in response to sophie-f

sophie-f wrote:

My issue started when I installed system update and updated my macOS to 13.4.1.

when I run xcodebuild I get this message:
Executable requires at least macOS 12.0, but is being run on macOS 10.16, and so is exiting.

• By the way, I have xcode version 14.3.1 (I can see it in "About XCode") but when I run "xcodebuild -version" I also get the error message from above.

What I tried:
Uninstalling and re-installing xcode and command line tools
• Downgrading xcode to 14.3.0

Please let me know how I can fix it.


Does the following show the current current location of the Xcode app you’re using?


$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
$


The version info (that you’ve tried, and have gotten an error) should look like this on macOS 13:


$ xcodebuild -version
Xcode 14.3.1
Build version 14E300c
$ 


The other cases I’ve occasionally met involved somebody that added aliases for the tooling, or that has an unexpected PATH.

Jul 17, 2023 9:21 PM in response to MrHoffman

Some time back, when using pyenv, I could not build a particular version of Python (Python needs to die), and the only solution was to set the environment variable:


export SYSTEM_VERSION_COMPAT=1


Having left this in my .zshrc, and forgotten about it, drove me nuts because xcode tools started reporting the wrong MacOS. You may find that you have done the same at some point. With this set, you will get, incorrectly:


ProductName: Mac OS X

ProductVersion: 10.16

BuildVersion: 21G651



As soon as you unset that (and remove it from .zshrc):


$ sw_vers

ProductName: macOS

ProductVersion: 12.6.7

BuildVersion: 21G651


And then it should go back to normal. I cannot swear that that is your issue, but that's what it was for me.





xcodebuild thinks I have an old version of macos

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.