xcrun

 

This manual page is part of Xcode Tools version 5.0

To obtain these tools:

If you are running a version of Xcode Tools other than 5.0, view the documentation locally:

  • In Xcode

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • To learn how the manual is organized or to learn about command syntax, read the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Developer Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



XCRUN(1)                                 BSD General Commands Manual                                XCRUN(1)



NAME
       xcrun - Run or locate development tools and properties.

SYNOPSIS
       xcrun [--sdk <SDK name>] --find <tool name>

       xcrun [--sdk <SDK name>] <tool name> ... tool arguments ...

       <tool name> ... tool arguments ...

DESCRIPTION
       xcrun  provides  a means to locate or invoke developer tools from the command-line, without requiring
       users to modify Makefiles or otherwise take inconvenient measures  to  support  multiple  Xcode  tool
       chains.

       The  tool xcode-select(1) is used to set a system default for the active developer directory, and may
       be overridden by the DEVELOPER_DIR environment variable (see ENVIRONMENT).

       The SDK which will be searched defaults to the boot system OS SDK, and can be specified by  the  SDK-ROOT SDKROOT
       ROOT  environment  variable  or the --sdk option (which takes precedences over SDKROOT). When used to
       invoke another tool (as opposed to simply finding it), xcrun will provide the absolute  path  to  the
       selected SDK in the SDKROOT environment variable. See ENVIRONMENT for more information.

   Usage
       xcrun  supports several different usages, to both look up the paths to tools as well as execute them.

       When used with the --find argument, as in xcrun [--sdk <SDK name>] --find <tool name>,  the  absolute
       path to the tool (in the provided SDK, if given) will be printed.

       When  used without --find, the name of a tool is required and the tool will be executed with the pro-vided provided
       vided arguments.

       When used as the target of a symbolic link, it derives the tool name to use  from  the  name  it  was
       invoked under, and then executes that tool.

OPTIONS
       -v, --verbose
              Add verbose information on how the tool lookup is performed.

       -n, --no-cache
              Don't  consult  the  cache  when  looking  up  values. In effect, causes the cache entry to be
              refreshed.

       -k, --kill-cache
              Removes the cache. Causes all values to be re-cached.

       --sdk  Specifies which SDK to search for tools. If no --sdk argument is provided, then the  SDK  used
              will be taken from the SDKROOT environment variable, if present.

       --toolchain
              Specifies  which  toolchain to use to perform the lookup. If no option:--toolchain argument is
              provided, then the toolchain to use will be taken from the TOOLCHAINS environment variable, if
              present.

       -l, --log
              Print the full command line that is invoked.

       -f, --find
              Enable  "find" mode, in which the resolved tool path is printed instead of the tool being exe-cuted. executed.
              cuted.

       -r, --run
              Enable "run" mode, in which the resolved tool path is executed with  any  provided  additional
              arguments. This is the default mode.

       --show-sdk-path
              Print the path to the selected SDK.

       --show-sdk-version
              Print the version number of the selected SDK.

       --show-sdk-platform-path
              Print the path to the platform for the selected SDK.

       --show-sdk-platform-version
              Print the version number of the platform for the selected SDK.

ENVIRONMENT
       DEVELOPER_DIR
          Overrides  the  active  developer  directory.  When  DEVELOPER_DIR  is set, its value will be used
          instead of the system-wide active developer directory.

       SDKROOT
          Specifies the default SDK to be used when looking up tools (some tools may have SDK specific  ver-sions). versions).
          sions).

          This  environment  variable  is also set by xcrun to be the absolute path to the user provided SDK
          (either via SDKROOT or the --sdk option), when it is used to invoke a normal developer tool (build
          tools like xcodebuild or make are exempt from this behavior).

          For example, if xcrun is used to invoke clang via:
              xcrun --sdk macosx clang test.c

          then  xcrun will provide the full path to the macosx SDK in the environment variable SDKROOT. That
          in turn will be used by clang(1) to automatically select that SDK when compiling the test.c  file.

       TOOLCHAINS
          Specifies  the  default  toolchain to be used when looking up tools (for tools which are toolchain
          specific).

       xcrun_log
          Same as specifying --log.

       xcrun_nocache
          Same as specifying --no-cache.

       xcrun_verbose
          Same as specifying --verbose.

EXAMPLES
       xcrun --find clang
          Finds the path to the clang binary in the default SDK.

       xcrun --sdk iphoneos --find texturetool
          Finds the path to the texturetool binary in the iOS SDK.

       xcrun --sdk macosx --show-sdk-path
          Prints the path to the current Mac OS X SDK.

       xcrun git status
          Locates the git command and then executes it with a single argument ("status").

DIAGNOSTICS
       When xcrun is invoked with the name xcrun, the options --log and --verbose are useful debugging aids.
       The  option --no-cache can be used to bypass cache lookup, but often at a significant cost in perfor-mance. performance.
       mance.

       When xcrun has taken the place of another tool, the arguments are those of the tool replaced, and the
       various xcrun options can't be used. In this case, use the specific environment variables instead.

SEE ALSO
       xcodebuild(1), xcode-select(1)

 

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcrun.1.html

转载于:https://www.cnblogs.com/yuwei0911/p/8454705.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值