I would like to have the Xcode installation side by side and use the DEVELOPER_DIR environment variable to choose between them.
, Xcode. xcode-select
, , , , , DEVELOPER_DIR
. --switch
:
, /Applications/Xcode -DP.app. (. sudo (8)) . shell, DEVELOPER_DIR (. ).
, " ":
, Xcode (,/Applications/Xcode.app/Contents/Developer). Xcode - , .
, <whatever>
Developer
, Xcode.
, xcrun DEVELOPER_DIR, ? :
• DEVELOPER_DIR=<whatever> command CC=$(xcrun -f --sdk macosx clang)
xcrun
, , , DEVELOPER_DIR
. xcode-select
"" DEVELOPER_DIR
. "" Xcode /usr/bin
. , '/usr/bin/clang' , xcrun
, /usr/bin/clang
clang
DEVELOPER_DIR
. , , - script, script DEVELOPER_DIR
, /usr/bin
.
• command CC=$(DEVELOPER_DIR=<whatever> xcrun -f --sdk macosx clang)
. clang
, , DEVELOPER_DIR
. , , , , - . , , , - , , , xcodebuild
, , , DEVELOPER_DIR
, .
, DEVELOPER_DIR
script, xcrun
, .