command line tools for OS X的安装
2015-10-01 16:24
741 查看
1、打开终端,输入“xcode-select --install”;
2、在弹出的对话框中,未安装Xcode则点击对应图标进行Xcode的安装 若已安装,则点击对话框中的“安装”按钮进行command line tools的安装。
3、安装完毕,在终端命令行输入“gcc -v”进行安装验证测试。之后可能会跳出以下语句:
xcrun: error: active developer path ("/Users/fighter/Desktop/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools
(or see `man xcode-select`)
以上大致意思是在当前的路径下找不到Xcode软件,要求修改Xcode的路径。具体办法:
xcode-select --switch +xcode.app的当前路径(依次打开Finder >>应用程序,用鼠标左键选中其中的Xcode.app图标拖到终端"xcode-select --switch "命令后即可。注意有空格)
4、按回车后终端跳出以下提示:
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
我们在password处输入计算的管理密码(即登录密码),然后按回车确认;
5、
这时,我们可以在终端中输入gcc -v进行安装测试。出现提示语句:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
至此,我们的command line tools就安装成功了。
2、在弹出的对话框中,未安装Xcode则点击对应图标进行Xcode的安装 若已安装,则点击对话框中的“安装”按钮进行command line tools的安装。
3、安装完毕,在终端命令行输入“gcc -v”进行安装验证测试。之后可能会跳出以下语句:
xcrun: error: active developer path ("/Users/fighter/Desktop/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools
(or see `man xcode-select`)
以上大致意思是在当前的路径下找不到Xcode软件,要求修改Xcode的路径。具体办法:
xcode-select --switch +xcode.app的当前路径(依次打开Finder >>应用程序,用鼠标左键选中其中的Xcode.app图标拖到终端"xcode-select --switch "命令后即可。注意有空格)
4、按回车后终端跳出以下提示:
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
我们在password处输入计算的管理密码(即登录密码),然后按回车确认;
5、
这时,我们可以在终端中输入gcc -v进行安装测试。出现提示语句:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
至此,我们的command line tools就安装成功了。
相关文章推荐
- android wifi 无线调试
- 从源码安装Mysql/Percona 5.5
- 对《大家都在点赞 Windows Terminal,我决定给你泼一盆冷水》一文的商榷
- 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用
- 对《大家都在点赞 Windows Terminal,我决定给你泼一盆冷水》一文的商榷
- 在Windows平台下使用安装GCC(图)
- 解决vc中unable to connect to the MKS:Internal error问题
- 命令行:增强版
- 杰奇一些安装详细说明文件,比官方更细
- 无线网卡安装DIY
- 网卡安装常见问题精解
- DB2数据库的安装
- CentOS下DB2数据库安装过程详解
- ghost安装系统软件硬盘安装器 安装ghost图文教程
- CentOS 6.3下编译安装Ruby 2.0笔记
- FREEBSD安装POSTGRESQL笔记
- Redis总结笔记(一):安装和常用命令
- FreeBSD 6.2 安装全程图解教程
- 安装Apache和PHP的一些补充
- Lua在windows下的安装及环境配置