xcrun -- run or locate development tools
xcrun [-sdk SDK] -find <tool_name>
xcrun [-sdk SDK] [-log] <tool_name> [<tool_arguments>]
xcrun provides a means locate or invoke coexistence- and platform-aware developer tools from the command-line, without requiring users to
modify makefiles or otherwise take laborious or inconvenient measures to adopt Xcode's multiple tool chains.
xcode-select is used to specify which installation of Xcode is used, and may be overridden by the DEVELOPER_DIR environment variable.
The SDK defaults to the current OS SDK, and can be specified by SDKROOT environment variable or the -sdk flag (which takes precedences over
The first usage returns the full path to the found tool_name.
The second usage executes tool_name with the given tool_arguments.
The last syntax is when xcrun replaces any of the standard UNIX developer tools (typically in /usr/bin). In this case, xcrun will use its
tool name to locate the corresponding tool within evaluated DEVELOPER_DIR and SDK.
If the tool is not named xcrun , tool_arguments are not parsed by xcrun.
display information about how the redirected path is constructed.
don't consult the cache when looking up values. In effect, causes the cache to be refreshed.
specifies which SDK to use. Overrides any SDKROOT set in the environment.
-log print the full command line that is invoked.
print the full path to the tool.
DEVELOPER_DIR - specifies the search path for locating the current developer tools (overrides xcode-select default).
SDKROOT - specifies the SDK to use; overriden by the command line -sdk flag.
xcrun_log - same as specifying -log
xcrun_nocache - same as specifying -no-cache
xcrun_verbose - same as specifying -verbose
When xcrun is invoked with the name xcrun , the flags -log and -verbose are useful debugging aids. The flag -no-cache can be used to bypass
When xcrun as taken the place of another tool, the arguments are those of the tool replaced, and the various xcrun flags can't be used. In
this case, use the specific environment variables instead.
xcodebuild -find Xcode coexistence