文章目录
Pod 命令
1、CocoaPods版本查看
pod --version
2、安装升级CocoaPods
sudo gem install cocoapods
如果报权限错误,执行以下命令
sudo gem install -n /usr/local/bin cocoapods
3、创建Podfile
$ vim Podfile
platform :ios, '9.0'
target "CocoapodsDemo" do
pod "AFNetworking"
pod 'Masonry'
end
注:冒号和ios是连着的,中间没有空格,有空格会报错。
esc取消输入,:wq退出编辑
4、添加第三方库(添加、更新、移除第三方库都用这个)
pod install
添加后我遇到一下提示信息
[!] The `CocoapodsDemo [Debug]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-CocoapodsDemo/Pods-CocoapodsDemo.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `CocoapodsDemo [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-CocoapodsDemo/Pods-CocoapodsDemo.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.