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)

你可能感兴趣的:(Carthage的安装与基本使用)