Reputation: 949
After upgrading to Xcode 12.5 (upgraded from the App Store), some CLI tools like xcodebuild
and codesign_allocate
are failing immediately, saying:
Executable requires at least macOS 11.0, but is being run on macOS 10.16, and so is exiting.
Even though these are failing, xcode-select works, and the location is set - running xcode-select -p
outputs /Applications/Xcode.app/Contents/Developer
. Everything seems to be installed, which xcode-select --install
indicates. I've tried installing the CLI from source, and putting the bin directory in PATH
seems to work ok, but this doesn't include xcodebuild
. However if I don't do manually install those cli tools, I still end up getting prompted to install the cli tools, and after they are "installed", I continue to get the prompt.
Everything within the Xcode IDE works fine, and I've tried reinstalling Xcode multiple times. I'm on the latest version of Big Sur (version 11.3), and this computer has never even had a version of macOS lower than that. Everything was working fine before this upgrade.
Upvotes: 3
Views: 2375
Reputation: 949
The issue was that I had set export SYSTEM_VERSION_COMPAT=1
in my .bashrc
. This caused the command sw_vers
to return ProductVersion 10.16, regardless of the actual version of macOS installed. Presumably Xcode version 12.5 started doing some check involving the os version before running binaries.
My solution was to just make sure that environment variable was set to false with export SYSTEM_VERSION_COMPAT=0
in my .bashrc
. Just not setting SYSTEM_VERSION_COMPAT
also works. To ensure that you have things are working, make sure that running sw_vers
shows the ProductVersion
that you expect, which should be >11.
Upvotes: 12