CocoaPods 配合终端使用

1.cd到当前项目路径
cd /Users/xxx/GitRepository/xcode/xxx
2.输入
touch podfile
3.输入
open podfile
4.回到终端
输入 pod search AFN
以AFNNetworking为例(搜索不需要输入完整名称)
5.粘贴pod 'AFNetworking', '~> 3.0' 到podfile 保存并关闭

podfile中格式为:

target 'xxx' do
pod 'AFNetworking', '~> 3.0'
end

注意:最新版本cocoapod 需要加入target

target 'xxx' do
.....
end

6.最后 终端输入
pod install --no-repo-update

7.只能 xcworkspace

    + cache         Manipulate the CocoaPods cache
    + deintegrate   Deintegrate CocoaPods from your project
    + env           Display pod environment
    + init          Generate a Podfile for the current directory
    + install       Install project dependencies according to versions from a
                    Podfile.lock
    + ipc           Inter-process communication
    + lib           Develop pods
    + list          List pods
    + outdated      Show outdated project dependencies
    + plugins       Show available CocoaPods plugins
    + repo          Manage spec-repositories
    + search        Search for pods
    + setup         Setup the CocoaPods environment
    + spec          Manage pod specs
    + trunk         Interact with the CocoaPods API (e.g. publishing new specs)
    + try           Try a Pod!
    + update        Update outdated project dependencies and create new Podfile.lock
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容