网上搜了篇文章,介绍iOS的越狱开发,其中提到了要给Xcode安装command line tools,以前从没听过这个工具,然后就google了下。
关于Xcode Command Line Tools的介绍:
https://developer.apple.com/library/ios/technotes/tn2339/_index.html
What is the Command Line Tools Package?
The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in OS X. It consists of two components: OS X SDK
and command-line tools such as Clang, which are installed in /usr/bin.
Command Line Tools的安装
这篇文章更为详细的介绍了Command Line Tools的安装
http://railsapps.github.io/xcode-command-line-tools.html
但是我按照网上说的方法,在Xcode >>Preferences >>download里面并没有看到有command line tools的下载,然后就开始按照上面帖子里面介绍的试一下各种命令。
在终端里面输入whoami
果然给我输出了我的Mac的名字,好神奇!
当我输入
$ xcode-select -p
确实返回了
/Applications/Xcode.app/Contents/Developer
说明我的Xcode安装的是个全版本的
接下来就到了安装Command Line Tools了
继续在终端里面输入:
$ xcode-select --install
系统就提示我是否进行下载,同意以后就开始下载了。
Verify that you’ve successfully installed Xcode Command Line Tools:
$ xcode-select -p /Library/Developer/CommandLineTools
Just to be certain, verify that gcc
is
installed:
$ gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix
安装了之后,我输入xcode-select -p命令仍然返回的是以前的结果,没有变化,但是我尝试输入 xcode-select -install的时候提示我已经安装过了。
证明确实Command Line Tools工具已经正确安装了,接下来就开始越狱的开发吧!