Xcode其本身路径不对导致的错误

问题例如:error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use xcode-select to change

个人是因为装Alcatraz的时候失败了,提示error如下:
Xcode Command Line Tools are not currently installed, and are required to run Alcatraz.

后来想起的我的 xcode7.2 是从朋友那边拷过来的,或许是因xcode本身的路径不对导致的问题。

下面介绍如何使用终端改xcode的路径:

1、打开终端
//确认当前工作位置
appledeMacBook-Pro-3:~ 09$ pwd
/Users/apple

//由于忘记具体执行代码 输入 xcode-select获取提示
appledeMacBook-Pro-3:~ 09$ xcode-select

----------
xcode-select: error: no command option given
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, --help                  print this help message and exit
  -p, --print-path            print the path of the active developer directory
  -s <path>, --switch <path>  set the path for the active developer directory
  --install                   open a dialog for installation of the command line developer tools
  -v, --version               print the xcode-select version
  -r, --reset                 reset to the default command line tools path
----------

//发现-p是获取 xcode现在路径;-s是转移到对应路径

appledeMacBook-Pro-3:~ 09$ xcode-select -p
/Users/apple/Documents/Xcode 2.app/Contents/Developer
//果然 xcode 不在应用程序中的位置

//ls 相应路径确认存在
appledeMacBook-Pro-3:~ 09$ ls /Applications/Xcode.app/Contents/Developer/
Applications    Library     Platforms   Tools
Documentation   Makefiles   Toolchains  usr

//-s 相应路径 将 xcode 转移到对应路径
appledeMacBook-Pro-3:~ 09$ xcode-select -s /Applications/Xcode.app/Contents/Developer/

//这里给我报了个错误
----------
xcode-select: error: --switch must be run as root (e.g. sudo xcode-select --switch <xcode_folder_path>).
----------
//然后我复制它给我的命令 将路径写入

appledeMacBook-Pro-3:~ 09$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
//提示输入本机密码
//输入后成功。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值