Carthage

作者: 流年易逝_李 | 来源:发表于2018-11-12 22:16 被阅读9次

Carthage类似于Cocoapods

1.安装brew

/usr/bin/ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.安装Carthage

brew install carthage

3.使用

1)使用Xcode创建工程cathage_demo

2)cd /Users/lichanglai/Desktop/cathage_demo

3)touch Cartfile

open -a Xcode Cartfile

4)修改Cartfile

1).使用远程资源git://, http://, ssh://

git "https://git.corpautohome.com/GP_APPMAIN_IOS_ARCH/AFNetworking.git" "7bc7fbdaac90844626aabc61842b6072e9edeeec"

2).使用本地路径

git "file:///Users/lichanglai/Desktop/ThirdControl/AsyncSocket" == 0.1.5

3).使用github

github "SDWebImage/SDWebImage"

可以指定分支/标签/提交.  不可混用

分支 git "file:///Users/lichanglai/Desktop/ThirdControl/SDWebImage" “dev”

标签 git "file:///Users/lichanglai/Desktop/ThirdControl/AsyncSocket" == 0.1.5

提交 git "file:///Users/lichanglai/Desktop/ThirdControl/SDWebImage" “84f67b127af44dd5b6db9e7f02ea42cc58fa44b8"

5)carthage update --platform iOS

6)添加frameWork

7)添加脚本

8)使用

使用过程中遇到run问题

unable to find utility "xcodebuild", not a developer tool or in PATH

选择Command Line Tools:

可以使用本地资源引入

git "file:///Users/lichanglai/Desktop/AFNetworking" == 3.1.0

若是Cartfile使用https的方式引入

git "https://git.corpautohome.com/ThirdControl.git"

则会遇到验证用户名密码问题

可通过全局的credential.helper的配置来使用osxkeychain helper解决

1)$ git credential-osxkeychain

# 如果出现以下提示说明已经安装

Usage: git credential-osxkeychain

2)$ git config --global credential.helper osxkeychain

3)$cd /Users/lichanglai/Desktop

$ mkdir tempdir

$cd tempdir

$ gitclonehttps://github.com/SVProgressHUD/SVProgressHUD.git

输入用户名,密码

再次进入项目所在目录,执行carthage update命令,就可以看到问题解决了

相关文章

网友评论

      本文标题:Carthage

      本文链接:https://www.haomeiwen.com/subject/bdehfqtx.html