2021-12-19
cocospod私有仓库
**
### 创建私有Spec Repo
**
在https://gitee.com 申请账号,新建仓库 NewLifePods
终端执行命令 :
查看本地仓库命令:pod repo list
添加到本地仓库:pod repo add NewLifePods https://gitee.com/soongit/NewLifePods.git
查看本地仓库命令:pod repo list
**
### 新建本地项目
**
1、在本地新建 Test 项目。
2、在 Test 项目中新建Test文件夹,把相关代码导入Test文件夹 (需要时创建Pod文件)
3、测试Test项目功能。
4、改项目名 Test2
**
### 创建Pod项目
**
1、在https://gitee.com 新建项目Test
2、终端执行命令 : git clone https://gitee.com/soongit/Test.git 下载到本地
3、将Test2项目下的 1、Test文件;2、工程文件;3、Podfile 考入Test文件夹
4、新建文件 Test.podspec 内容如下:
Pod::Spec.new do |s|
s.name = 'Test'
s.version = '0.0.1'
s.ios.deployment_target = '8.0'
s.license = 'MIT'
s.summary = 'Test is a test.'
s.homepage = 'https://gitee.com/soongit/Test.git'
s.authors = { 'ccccc' => 'ccccc@126.com'}
s.source = { :git => 'https://gitee.com/soongit/Test.git', :tag => s.version.to_s }
s.description = 'Test is a simple photo browser'
s.source_files = 'Test/*.{h,m}'
s.framework = 'UIKit'
s.requires_arc = true
s.dependency 'SDWebImage', '~> 3.7.3'
end
**
### 向Spec Repo提交podspec
**
终端执行命令:
git add .
git commit -s -m "Initial Commit of Library"
git remote add origin git@gitee.com:ccccc/Test.git #添加远端仓库
git push origin master
git tag "0.1.0"
git push --tags
pod lib lint --allow-warnings
pod lib lint --allow-warnings --sources=https://gitee.com/soongit/NewLifePods.git,master
pod repo push NewLifePods Test.podspec --allow-warnings
--use-libraries
**
### pod search 不到刚提交的项目。更新本地仓库
**
执行 'pod repo update'更新本地仓库,执行时间有点长,请耐心等待一会。本地仓库完成后,即可搜索到指定的第三方库。
另一种方法:执行命令'rm ~/Library/Caches/CocoaPods/search_index.json',删除该文件,然后再执行pod search 命令就可以正常使用了。
### 升级到1.8以上,pod repo push 报cdn错误解决方案
**
https://zhaoxin.pro/15695124897584.html
pod repo remove trunk
**
### 注意
**
在 .h 文件中引入pod中的文件 需要<YTKNetwork/YTKRequest.h>
**
### 升级xcode 12 遇到pod lib lint 遇到的问题 for architecture arm64 xcode 12 cocoapods
**
在podspec中加入
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios/63955114#63955114