Mac OS: 12.3.1 Monterey (Mac Mini 202
Xcode: 13.4.1
'xcodebuild -version' hangs indefinitely for most users, except for one local admin account and one non-admin account (LDAP user). I've searched high and low and found some related issues on this forum and elsewhere, most of which indicate that the Xcode license has not been accepted and provide instructions to accept it from the command line. All of these have been tried countless times, plus Xcode 13.4.1 and CommandLineTools have been reinstalled, and still the issue remains: Only one non-admin user (myself) and the local admin user can run 'xcodebuild' from the command line without hanging. The same is true from Mac Terminal application in a remote console (VNC) session, or putty/xterm connected remotely via ssh.
We can't upgrade Mac OS or Xcode as this is a build/test machine in a server farm and the specific OS and Xcode versions are required minimums for customer support purposes.
Doesn't seem that there is setting unique to each user that could enable/disable Xcode, but the inner workings of Mac OS and Xcode remain largely a mystery.
Please help!