精华内容
下载资源
问答
  • 我遇到一个非常诡异的问题,网上所有人都说用sudo xcode-select -s来切换默认的xcode,但是我的电脑上就是不生效,orz。找了无数个解决办法,没用。 只好去万能的Stack Overflow找答案,果然还是有人和我一样,遇到...

    我遇到一个非常诡异的问题,网上所有人都说用sudo xcode-select -s来切换默认的xcode,但是我的电脑上就是不生效,orz。找了无数个解决办法,没用。 只好去万能的Stack Overflow找答案,果然还是有人和我一样,遇到了这个奇葩问题。回答里面,有位老哥是这么说的:

    It happened to me once: xcode-select -print-path did stick to the same value and wasn't changing. It appeared that it was always equal to DEVELOPER_DIR environment variable. According to the manpage of xcode-select:

    When DEVELOPER_DIR is set, its value will be used instead of the value last passed to -switch xcode_path So, unsetting DEVELOPER_DIR makes xcode-select -switch working.

    大意就是,xcode如果设置了DEVELOPER_DIR,那么之后,无论你怎么使用xcode-select -s都是无法改变默认xcode的,WTF! 那要如何做呢?也很简单,就下面一行命令。

    unset DEVELOPER_DIR

    这时候,你再去用xcode-select -switch,就能改变默认xcode了,但是...有一句话叫做,但是前面的都是废话,没错,如果你用的是脚本xcodebuild来打包的话,恭喜你,虽然改变了默认的xcode command line,但是这个xcodebuild依然使用的是默认的xcode,而不是你切换后的xcode。orz,我已经服了。有哪位有解决办法的,请贴出来,感激不尽。

    20171212 update http://www.jianshu.com/p/472211c5cacd 这位和我一样遇到这个问题,他解决了,绝望的同学可以试试。

    展开全文
  • macOS Command - xcode-select

    2021-03-09 21:34:56
    文章目录一、关于 xcode-select二、使用示例多个 Xcode 切换安装 CommandLineTools重置查看版本打印目前指向的路径三、manualNAMESYNOPSISDESCRIPTIONUsageOPTIONSENVIRONMENTEXAMPLESFILESSEE ALSOHISTORY相关资料 ...


    一、关于 xcode-select

    xcode-select - Manages the active developer directory for Xcode and BSD tools.
    字面简单可理解为,选择 Xcode


    二、使用示例

    多个 Xcode 切换

    当一个系统上安装了多个 Xcode 应用,

    比如安装在这两个地址: /Applications/Xcode.app/Applications/Xcode-beta.app,可以使用 xcode-select --switch path/to/Xcode.app 来决定使用哪个 Xcode 来在命令行中使用来开发。


    在 Xcode 中查看使用的 CommandLineTools

    Xcode --> Preferences --> Locations --> Command Line Tools
    在这里插入图片描述


    安装 CommandLineTools

    $ sudo rm -rf /Library/Developer/CommandLineTools # 移除原有的 CommandLineTools,否则可能会报 the tools are already installed
    $ xcode-select --install
    

    重置

    $ sudo xcode-select -r  # 或者 sudo xcode-select --reset
    

    查看版本

    $ xcode-select -v  # 或者 xcode-select --version
    xcode-select version 2384.
    

    打印目前指向的路径

    $ xcode-select -p
    /Applications/Xcode.app/Contents/Developer
    

    三、manual

    XCODE-SELECT(1) BSD General Commands Manual XCODE-SELECT(1)

    NAME

    ​ xcode-select - Manages the active developer directory for Xcode and BSD tools.


    SYNOPSIS

    xcode-select [-h|–help] [-s|–switch ] [-p|–print-path] [-v|–version]


    DESCRIPTION

    xcode-select controls the location of the developer directory used by xcrun(1), xcodebuild(1), cc(1), and other Xcode and BSD development tools. This also controls the locations that are searched for by man(1) for developer tool manpages.

    ​ This allows you to easily switch between different versions of the Xcode tools and can be used to update the path to the Xcode if it is moved after installation.


    Usage

    ​ When multiple Xcode applications are installed on a system (e.g. /Applications/Xcode.app, containing the latest Xcode, and /Applications/Xcode-beta.app containing a beta) use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools.

    ​ After setting a developer directory, all of the xcode-select provided developer tool shims (see FILES) will automatically invoke the version of the tool inside the selected developer directory. Your own scripts, makefiles, and other tools can also use xcrun(1) to easily lookup tools inside the active developer directory, making it easy to switch them between different versions of the Xcode tools and allowing them to function properly on systems where the Xcode application has been installed to a non-default location.


    OPTIONS

    -h, --help

    ​ Prints the usage message.


    -s <path>, --switch <path>

    ​ Sets the active developer directory to the given path, for example /Applications/Xcode-beta.app. This command must be run with superuser permissions (see sudo(8)), and will affect all users on the system. To set the path without superuser permissions or only for the current shell session, use the

    ​ DEVELOPER_DIR environment variable instead (see ENVIRONMENT).


    -p, --print-path

    ​ Prints the path to the currently selected developer directory. This is useful for inspection, but scripts and other tools should use xcrun(1) to locate tool inside the active developer directory.


    -r ,--reset

    ​ Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism. This command must be run with superuser permissions (see sudo(8)), and will affect all users on the system.


    -v, --version

    ​ Prints xcode-select version information.


    --install

    ​ Opens a user interface dialog to request automatic installation of the command line developer tools.


    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.

    ​ Note that for historical reason, the developer directory is considered to be the Developer content directory inside the Xcode application (for example /Applications/Xcode.app/Contents/Developer). You can set the environment variable to either the actual Developer contents directory, or the Xcode application directory – the xcode-select provided shims will automatically convert the environment variable into the full Developer content path.


    EXAMPLES

    xcode-select --switch /Applications/Xcode.app/Contents/Developer

    Select /Applications/Xcode.app/Contents/Developer as the active developer directory.


    xcode-select --switch /Applications/Xcode.app

    ​ As above, selects /Applications/Xcode.app/Contents/Developer as the active developer directory. The Developer content directory is automatically inferred by xcode-select.


    /usr/bin/xcodebuild

    Runs xcodebuild out of the active developer directory.


    $ /usr/bin/xcrun --find xcodebuild
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
    

    ​ Use xcrun to locate xcodebuild inside the active developer directory.


    env DEVELOPER_DIR="/Applications/Xcode-beta.app" /usr/bin/xcodebuild

    ​ Execute xcodebuild using an alternate developer directory.


    FILES

    /usr/bin/xcrun

    ​ Used to find or run arbitrary commands from the active developer directory. See xcrun(1) for more information.


    /usr/bin/actool /usr/bin/agvtool /usr/bin/desdp /usr/bin/genstrings /usr/bin/ibtool /usr/bin/ictool /usr/bin/instruments /usr/bin/iprofiler /usr/bin/opendiff /usr/bin/pip3 /usr/bin/python3 /usr/bin/sdef /usr/bin/sdp /usr/bin/stapler /usr/bin/xcodebuild /usr/bin/xcscontrol /usr/bin/xcsdiagnose /usr/bin/xed

    ​ Runs the matching Xcode tool from with the active developer directory.


    /usr/bin/BuildStrings /usr/bin/CpMac /usr/bin/DeRez /usr/bin/GetFileInfo /usr/bin/MergePef /usr/bin/MvMac /usr/bin/ResMerger /usr/bin/RezDet /usr/bin/RezWack /usr/bin/Rez /usr/bin/SetFile /usr/bin/SplitForks /usr/bin/UnRezWack /usr/bin/ar /usr/bin/as /usr/bin/asa /usr/bin/bison /usr/bin/c89 /usr/bin/c99
    /usr/bin/clang++ /usr/bin/clang /usr/bin/cmpdylib /usr/bin/codesign_allocate /usr/bin/cpp /usr/bin/ctags /usr/bin/ctf_insert /usr/bin/dsymutil /usr/bin/dwarfdump /usr/bin/flex++ /usr/bin/flex /usr/bin/g++ /usr/bin/gatherheaderdoc /usr/bin/gcc /usr/bin/gcov /usr/bin/git-receive-pack /usr/bin/git-shell
    /usr/bin/git-upload-archive /usr/bin/git-upload-pack /usr/bin/git /usr/bin/gm4 /usr/bin/gnumake /usr/bin/gperf /usr/bin/hdxml2manxml /usr/bin/headerdoc2html /usr/bin/indent /usr/bin/install_name_tool /usr/bin/ld /usr/bin/lex /usr/bin/libtool /usr/bin/lipo /usr/bin/lldb /usr/bin/lorder /usr/bin/m4
    /usr/bin/make /usr/bin/mig /usr/bin/mkdep /usr/bin/nm /usr/bin/nmedit /usr/bin/objdump /usr/bin/otool /usr/bin/pagestuff /usr/bin/ranlib /usr/bin/rebase /usr/bin/redo_prebinding /usr/bin/resolveLinks /usr/bin/rpcgen /usr/bin/segedit /usr/bin/size /usr/bin/strings /usr/bin/strip /usr/bin/swift
    /usr/bin/swiftc /usr/bin/unifdef /usr/bin/unifdefall /usr/bin/vtool /usr/bin/xml2man /usr/bin/yacc

    Runs the matching BSD tool from with the active developer directory.


    SEE ALSO

    xcrun(1), xcodebuild(1)


    HISTORY

    ​ The xcode-select command first appeared in Xcode 3.0.

    Mac OS X Jun 24, 2019 XCODE-SELECT(1)

    ~


    相关资料

    展开全文
  • xcode-select 指定xcode命令行工具版本

    千次阅读 2019-11-14 14:01:29
    sudo xcode-select --switch /指定版本的xcode路径Xcode.app 恢复默认的xcode命令行版本 当使用xcodebuild莫名其妙的出问题时,可以考虑使用此命令恢复 sudo xcode-select -r 使用对话框安装命令行工具 sudo ...

    切换xcode命令行版本

    sudo xcode-select --switch /指定版本的xcode路径Xcode.app 
    

    恢复默认的xcode命令行版本
    当使用xcodebuild莫名其妙的出问题时,可以考虑使用此命令恢复

    sudo xcode-select -r
    

    使用对话框安装命令行工具

    sudo xcode-select --install
    
    展开全文
  • Xcode 更改默认版本 xcode-select

    万次阅读 2017-04-07 16:47:01
    我们的Xcode使用版本可以根据...我们本文介绍的是在终端使用xcode-select命令 根据需求修改使用的Xcode版本。在终端xcode-select可使用的命令如下: 1. xcode-select [-h, –help] 2. xcode-select [-p, –print-p

    我们的Xcode使用版本可以根据Xcode > Preferences > Locations路径查看到正在使用的版本和该版本路径。

    这里写图片描述

    我们本文介绍的是在终端使用xcode-select命令 根据需求修改使用的Xcode版本。

    在终端xcode-select可使用的命令如下:
    1. xcode-select [-h, –help]
    2. xcode-select [-p, –print-path]
    3. xcode-select [-s , –switch ]
    4. xcode-select [-v, –version]
    5. xcode-select [-r, –reset ]

    1. 查看xcode-select可使用命令,使用如下命令

      1. xcode-select -h
        or
      2. xcode-select --help
    2. 查看当前正在使用的Xcode版本路径,使用如下命令

      1. xcode-select -p
        or
      2. xcode-select --print-path
    3. 查看xcode-select版本

      1. xcode-select -v
        or
      2. xcode-select --version
    4. 重置为默认的command line tools path

      1. xcode-select -r
        or
      2. xcode-select -reset

      1. 修改Xcode使用版本

      1. sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        or
      2. sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

    本文转载 http://blog.sina.com.cn/s/blog_605409770102uwxc.html

    展开全文
  • xcode-select - 更改默认Xcode

    千次阅读 2018-10-12 20:29:05
    如果你的电脑中有几个xcode版本,比如一个xcode5.1.1,一个xcode6-beta,当你打开工程的时候,通常会有一个默认配置,或者使用终端命令行操作,需要选择使用xcode的不同版本,怎么更改这个配置呢?请看下文: 开发...
  • xcode-select – 更改默认Xcode  (2014-07-07 15:00:41) 转载▼   分类: iOS 如果你的电脑中有几个xcode版本,比如一个xcode5.1.1,一个xcode6-beta, 当你打开工程的时候,...
  • xcode-select

    2012-06-02 15:05:29
    xcode-select Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path. [code="java"]/usr/bin/xcode-select -switch /...
  • 在mac下使用git或者npm install 时经常遇到下面的问题: xcrun: error: active developer path ("...) does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xco...
  • Xcode 4.3 xcode-select路径问题

    千次阅读 2013-07-31 00:49:01
    事情是这样的。家里那台 Macbook Pro 装的是 Xcode 4.2.x,公司用的 Mini Mac 装...4.3 在终端下 make 编译会遇到错误,总是提示需要通过 xcode-select 来更新什么路径,也不太明白。直到遇到了 icyleaf 和 User y
  • tool: xcode-select

    2020-04-06 18:34:38
    $ sudo rm -rf /Applications/Xcode.app ...xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer/") does not exist, use xcode-select --switch path/to/Xcode.ap...
  • xcode-select --install 解决方案

    万次阅读 多人点赞 2018-01-11 17:46:28
    背景 Mac下安装tesseract时,出现如下问题 Error: Xcode alone is not sufficient on Sierra. Install the Command Line Tools: xcode-select --install 但Mac最新场景下安装...根据提示在使用命令xcode-select
  • xcode-select --install // 安装命令 xcode-select --version // 查看版本 有时Command Line Tools出了问题,可以先尝试恢复默认设置来解决: // 恢复默认设置(需要sudo权限) sudo xcode-select --reset 还是...
  • xcode路径 xcode-select -print-path

    千次阅读 2014-02-12 16:46:50
    xcode路径引起的问题,使用xcode-select -print-path 显示后再使用Xcode-select -switch更改 在使用InstrumentDriver做iOS自动化测试,其他Mac电脑上都用的好好的,遇到一台MBP,总是无法自动启动iPhone模拟器。 ...
  • Could not automatically select an Xcode project. Specify one in your Podfile like so:    xcodeproj 'path/to/Project.xcodeproj'    在Podfile文件里指定下工程目录就行了,比如...
  • 报错xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance 报这个错误的原因是xcode-select不在...
  • xcode-select: error: tool

    2021-03-15 00:29:39
    xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory '/Library/D… 报这个错误的原因是xcode-select不在默认的路径 1.终端命令找到xcode-select当前路径 xcode-select --...
  • 原因是xcode无法确定路径 命令: sudo xcode-select --switch /Applications/Xcode.app (/Applications/Xcode.app ->直接打开程序把Xcode往命令窗口拖即可)。
  • Could not automatically select an Xcode project. Specify one in your Podfile li 解决方案如下: xcodeproj ‘工程名.xcodeproj’,如下图
  • 我的mac装了多个xcode 今天发现.有些东西编译时候要用到xcode 但因为我的xcode把名字改了.... 打开终端 sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 改变当前的xcode路劲
  • mac卸载了xcode后,运行软件提示:xcode-select: error: invalid developer directory 解决方法: xcode-select --install
  • <p>xcode-select: error: tool 'ibtool' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance make[2]: <strong><em> [bin/...
  • Add xcode-select to README

    2020-12-09 00:29:40
    $ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer </code></pre> <p>Putting this here to help others who may run into the issue. Perhaps this could be added to the README.</p><p>...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,268
精华内容 1,307
关键字:

selectxcode