项目中用到CocoaPods来管理第三方库文件,这就需要安装,首先说吧,网上一大片安装方法和使用,但是经过一番折腾,组合查询,最终能安装成功并运行Xcode 工程,这里将简要罗列安装步骤,便于快速安装,至于每一步为什么这样,请不要问我,网上已经有大量描述,后面我会给出参考文章(标注-红色为我们手动输入,黑色为命令行自己输出):
第一步骤:
mapboo:~ mapboo$ gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sources
mapboo:~ mapboo$ gem sources -a http://ruby.taobao.org/
http://ruby.taobao.org/ added to sources
mapboo:~ mapboo$ gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org/
mapboo:~ mapboo$ sudo gem install cocoapods
Fetching: cocoapods-core-0.34.4.gem (100%)
Successfully installed cocoapods-core-0.34.4
Fetching: xcodeproj-0.19.4.gem (100%)
Successfully installed xcodeproj-0.19.4
Fetching: cocoapods-trunk-0.3.1.gem (100%)
Successfully installed cocoapods-trunk-0.3.1
Fetching: cocoapods-0.34.4.gem (100%)
Successfully installed cocoapods-0.34.4
Parsing documentation for cocoapods-core-0.34.4
Installing ri documentation for cocoapods-core-0.34.4
Parsing documentation for xcodeproj-0.19.4
Installing ri documentation for xcodeproj-0.19.4
Parsing documentation for cocoapods-trunk-0.3.1
Installing ri documentation for cocoapods-trunk-0.3.1
Parsing documentation for cocoapods-0.34.4
Installing ri documentation for cocoapods-0.34.4
4 gems installed
至此,第一步安装成功,参考: http://code4app.com/article/cocoapods-install-usage。
第二步骤:
mapboo:XX_Project mapboo$ pod install --verbose --no-repo-update
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods`:
(`$(ARCHS_STANDARD)`)
Finding Podfile changes
- pop
Resolving dependencies of `Podfile`
Creating shallow clone of spec repo `master` from `https://github.com/CocoaPods/Specs.git`
$ /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1
Cloning into 'master'...
Checking out files: 100% (24223/24223), done.
.
Comparing resolved specification to the sandbox manifest
- pop
Downloading dependencies
-> Using pop (1.0.7)
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Adding source files to Pods project
- Adding frameworks to Pods project
- Adding libraries to Pods project
- Adding resources to Pods project
- Linking headers
- Installing targets
- Installing target `Pods-pop` iOS 6.0
- Installing target `Pods` iOS 6.0
- Running post install hooks
- Writing Xcode project file to `Pods/Pods.xcodeproj`
- Writing Lockfile in `Podfile.lock`
- Writing Manifest in `Pods/Manifest.lock`
Integrating client project
Integrating target `Pods` (`customer/customer.xcodeproj` project)
[!] The `customer [Debug]` target overrides the `CLANG_CXX_LIBRARY` build setting defined in `../Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `customer [Release]` target overrides the `CLANG_CXX_LIBRARY` build setting defined in `../Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
//XX_Project: 是你的项目工程所在文件夹
至此,第二步安装成功,参考:http://blog.csdn.net/ralbatr/article/details/39082937。
截图如下:
图1
图2