组件化设计管理工具Carthage
作者:互联网
Carthage管理工具的使用
安装/更新Homebrew工具
- 1、/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
- 2、brew install carthage
如果抱警告:Warning: carthage 0.30.1 is already installed, it’s just not linked You can usebrew link carthage
to link this version. - 3、brew link carthage
- 4、brew install carthage
如果还是报警告:Warning: carthage 0.30.1 is already installed and up-to-date To reinstall 0.30.1, runbrew reinstall carthage
- 5、brew reinstall carthage 成功了
第二步:源码方式=>项目安装carthage
- 1、在项目根目录新建carthage文件
命令:touch Cartfile
- 2、打开Cartfile文件添加第三方库
例如:github “rs/SDWebImage” - 3、安装命令:
carthage update
可能会静态库编译不过报错,错误信息如下:
*** Fetching SDWebImage
*** Checking out SDWebImage at “4.4.2”
*** xcodebuild output can be found in /var/folders/7w/4gr2dxc57v3656mjgqmv9mkm0000gn/T/carthage-xcodebuild.XWTgwJ.log
A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/yangshaohong/Desktop/Course/iOS/framework/project/Dream_20180902_TZVideo_02/Carthage/Checkouts/SDWebImage/SDWebImage.xcworkspace CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 72:
xcrun: error: unable to find utility “xcodebuild”, not a developer tool or in PATH
解决办法:为Carthage是先将第三方框架编译成动态库(.framework的二进制文件),所以需要先指定一个编译工具。在Xcode > Preferences > Locations中的下拉菜单里选择命令行工具。
标签:xcodebuild,carthage,Carthage,管理工具,brew,install,组件,SDWebImage 来源: https://blog.csdn.net/zhuxincheng_1218/article/details/99676056