iOS—— git本地记录与Xcode名字关联引起的bug

记录一下日常生活中遇到的bug。

因调试不同iOS系统设备或保险一点,电脑上常放置多个版本的Xcode。昨天下载了最新的Xcode 9 正式版。电脑上还放有Xcode 9 beta3版本和Xcode 8.3.3版本。因为之前Xcode 9 beta3版本改成名上Xcode2,解压了正式的Xcode 9版本后,又得调整名字了。然后按从小到大的顺序。改名Xcode1、Xcode2、Xcode3。改完点击Enter键时,还弹出一个提示框,大意是:是否确定改名,这样可能会引起其他相关的问题。

        改完了,后面在用终端 git命令更新资料文档时,报xcrun: error: active developer path ("/Applications/Xcode 2.app/Contents/Developer") does not exist.错误(错误提示忘记保存了)。

Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.

See `man xcode-select` for more details.

ShawdeMacBook-Pro:iGetWellDoc shaw$ sudo xcode-select --switch /Applications/Xcode 9

Password:

xcode-select: error: invalid argument '9'

Usage: xcode-select [options]

Print or change the path to the active developer directory. This directory

controls which tools are used for the Xcode command line tools (for example,

xcodebuild) as well as the BSD development commands (such as cc and make).

Options:

-h, --helpprint this help message and exit

-p, --print-pathprint the path of the active developer directory

-s , --switch set the path for the active developer directory

--installopen a dialog for installation of the command line developer tools

-v, --versionprint the xcode-select version

-r, --resetreset to the default command line tools path

猜测名字中不能带空格,去掉后。

提示要安装Xcode-select

安装完后,使用命令sudo xcode-select --switch /Applications/Xcode3.app/Contents/Developer  

成功切换

ShawdeMacBook-Pro:iGetWellDoc shaw$ sudo xcode-select --switch /Applications/Xcode3.app/Contents/Developer

ShawdeMacBook-Pro:iGetWellDoc shaw$

ShawdeMacBook-Pro:iGetWellDoc shaw$

ShawdeMacBook-Pro:iGetWellDoc shaw$

ShawdeMacBook-Pro:iGetWellDoc shaw$ git branch -a

*master

remotes/origin/HEAD-> origin/master

remotes/origin/master

ShawdeMacBook-Pro:iGetWellDoc shaw$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

完结。废话一堆,重点就是加粗字体部分。

你可能感兴趣的:(iOS—— git本地记录与Xcode名字关联引起的bug)