资源描述:
《cocoapods公共类库管理方案和使用心得》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、CocoaPods第三方库集成管理应用CocoaPods安装1.检查是否安装xcode开发工具打开终端,运行:xcode-select--install如果已安装,输出xcode-select的使用命令,如果未安装,会自动跳出安装程序,进行安装即可;注:如果不安装,安装cocoaPods的buildingnativeextension阶段报错;2.更新gem在终端中运行:gem–v,ruby–v,检查当前gem和ruby的版本;最好将gem为最新版本,防止安装cocoaPods出现版本太old的意外情况;sudogemupdate-system如果用国外的源更
2、新较慢的话,可以换成淘宝的源gemsource--removehttps://rubygems.org/gemsource–ahttp://ruby.taobao.org/可以通过gemsource–l查看当前的gem源3.安装cocoaPods和pod命令行环境安装:sudogeminstallcocoapods设置cocoaPods环境:podsetup安装过程中可能比较慢,请耐心等待,安装完成之后,使用podlist验证是否安装成功,如果安装成功,该命令可以显示当前cocoaPod公共库中所有可以调用的类库名称和版本号;详细安装步骤:http://www
3、.360doc.com/content/14/0309/10/11029609_358970353.shtmlotherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevic
4、toryofthelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,MinistersandcocoaPods常用使用命令1.第一次运行:podhelp查看各个命令的用途2.查看你的工程库中的某个第三方库是否在pod的仓库中:命令
5、:podsearch***可以看到最新的版本信息和source地址:->SDWebImage(3.7.1)AsynchronousimagedownloaderwithcachesupportwithanUIImageViewcategory.pod'SDWebImage','~>3.7.1'-Homepage:https://github.com/rs/SDWebImage-Source:https://github.com/rs/SDWebImage.git-Versions:3.7.1,3.7.0,3.6,3.5.4,3.5.2,3.5.1,3.5,3.
6、4,3.3,3.2,3.1,3.0,2.7.4,2.7,2.6,2.5,2.4[masterrepo]-Subspecs:-SDWebImage/Core(3.7.1)-SDWebImage/MapKit(3.7.1)-SDWebImage/WebP(3.7.1)3.创建Podfile文件具体podfile文件编写参考:http://guides.cocoapods.org/syntax/podfile.htmltip:引用自己的gitlibray:pod'NetEasePatch',:git=>'https://git.ms.netease.com/huip
7、ang/neteasepatch.git'引用cocoaPods库时:pod'SDWebImage''3.1.1'注意:最好是加上版本号,防止版本升级造成工程编译通不过;4.创建pod工作空间:编写完Podfile文件之后:第一次运行:podinstall以后更新运行:podupdateotherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingi
8、n1939servedasrecord