安装多个版本的 CocoaPods

在版本开发过程中,可能需要多个版本的 cocoaPodsCocoapods 的安装

// 移除指定版本  
sudo gem uninstall cocoapods -v 1.3.1

// 安装指定版本
OS X 10.11 之前系统的安装 CocoaPods 指令: $ sudo gem install cocoapods -v 1.5.3

OS X 10.11 以后系统的安装 CocoaPods 指令: $ sudo gem install -n /usr/local/bin cocoapods -v 1.5.3
:~ shiran$ sudo gem install -n /usr/local/bin cocoapods -v 1.5.3
Password:
Fetching fourflusher-2.0.1.gem
Fetching cocoapods-core-1.5.3.gem
Fetching cocoapods-1.5.3.gem
Successfully installed fourflusher-2.0.1
Successfully installed cocoapods-core-1.5.3
Successfully installed cocoapods-1.5.3
Parsing documentation for fourflusher-2.0.1
Installing ri documentation for fourflusher-2.0.1
Parsing documentation for cocoapods-core-1.5.3
Installing ri documentation for cocoapods-core-1.5.3
Parsing documentation for cocoapods-1.5.3
Installing ri documentation for cocoapods-1.5.3
Done installing documentation for fourflusher, cocoapods-core, cocoapods after 4 seconds
3 gems installed

CocoaPods 其实并不是覆盖安装,除非你显式的删除

安装成功:
:~ shiran$ pod --version
1.7.5
:~ shiran$ pod _1.5.3_ --version
1.5.3

查看 安装的版本:
:~ shiran$ gem list cocoapods

*** LOCAL GEMS ***

cocoapods (1.7.5, 1.5.3)
cocoapods-core (1.7.5, 1.5.3)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
cocoapods-try (1.1.0)

安装后可以通过以下命令指定 CocoaPods 的版本:

// 执行默认版本 pod --verison 的版本
pod install
// 切换至指定版本
pod _1.3.1_ install

参考链接 :https://www.jianshu.com/p/8bad2e665394

你可能感兴趣的:(安装多个版本的 CocoaPods)