Carthage的安装与基本使用

Carthage

⚠️ 以下阴影部分皆终端操作

1.检查是否安装过:

carthage version

⚠️如果输出版本号,如0.20.0 说明已经安装过

2.安装Carthage

brew install 

brew install carthage  

// 安装后,检查是否安装成功:carthage version

3.使用Carthage

cd /Users/Louis/DeskTop/Swifter    // 进入项目文件夹

touch Cartfile                                  // 创建文件夹,用来存三方库

open -a Xcode Cartfile                    // 用Xcode打开文件,输入第三方库

在打开的文件夹中输入要加载的三方库,例: github "daltoniam/Starscream"  

carthage update --platform iOS      // 更新,同步第三方库

4.工程中的配置

步骤一:Taget -> General -> Linked Frameworks and Libraries -> + -> Add other

步骤二:在Carthage->  Build  ->  iOS  ->  ***.framework,选中需要的,Open。

步骤三:Target -> Build Phases -> + -> New Run Script Phase

步骤四:在Shell下1后框中输入:/usr/local/bin/carthage copy-frameworks

步骤五:在Input Files中添加: $(SRCROOT)/Cathage/Build/iOS/***.framework

❌  Command /bin/sh failed with exit code 1

解决办法:勾选 Run Script only when installing

❌  *** Reason: image not found

解决办法:Taget -> General -> Linked Frameworks and Libraries 

将Status:   Required -> Optional

5.想了解更详细的情况,请点击Carthage

UnicodeEncodeError: 'ascii' codec can't encode characters in position 317-343: ordinal not in range(128)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容