Setting the DEVELOPER_DIR variable takes precedence over using xcode-select but I'm curious, what is the difference between the two?
Which should I use if I'm running multiple Xcode versions on the same machine?
Setting the DEVELOPER_DIR variable takes precedence over using xcode-select but I'm curious, what is the difference between the two?
Which should I use if I'm running multiple Xcode versions on the same machine?
xcode-select will always take effect system-wide. DEVELOPER_DIR can be used in a per-shell environment. DEVELOPER_DIR thus allows you to have more precise control over Xcode version on a per-project basis in for example a continous integration setup.
E.g. imagine that you would have each project changing version via xcode-select, then if two separate projects builds run concurrently then you would likely have problems. But if you instead setup each project / CI environment to export it's own DEVELOPER_DIR, then concurrent builds won't be an issue.