创建插件库操作记录 - lanligang/NearPublicProject GitHub Wiki

  • 前面的操作先不做记录 *遇到的问题
更新 cocoapods 时,使用命令
pod trunk push --allow-warnings
终端抛出了一个错误:
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH ) during validation.

###解决方法

Xcode > Preferences > Locations Command Line Tools: 这一栏,一开始发现是空的 需要选择一个,就只有一个 我这里选择的是 Xcode 11.2.1 (11B500)

1、注册trunk

终端使用:

pod trunk register [email protected] --description= 'abs Mac' --verbose

//如果成功会有这样的输出
[!] Please verify the session by clicking the link in the verification email that has been 
sent to [email protected]
接下来点击邮箱的邮件

命令验证:
pod trunk me

输出:类似

ios2de  i:~ ios2$ pod trunk me
  - Name:     fdhhg Mac mini
  - Email:    [email protected]
  - Since:    July 22nd, 01:41
  - Pods:     None
  - Sessions:
    - July 22nd, 01:41 - November 27th, 01:42. IP: jhhhh
    Description: 
podspec 文件创建-------------

git add -A
git commit -m "添加 podspec 文件"

git tag 0.0.1      // 版本号注意:一定要和代码中的一致
git push --tags    //这个必须要有

验证命令:
pod spec lint aaa.podspec --allow-warnings
//提交命令
pod trunk push  aaa.podspec --allow-warnings
  • 下面 简单介绍一下 我们的podspec 文件如何编写 个人编写的pod 文件
Pod::Spec.new do |s|

  s.name     = 'ChartView'

  s.version  = '0.0.1'

  s.license  = { :type => 'MIT' }

  s.summary  = '饼图、折线图、柱状图'

  s.description = <<-DESC
                    描述内容
                   DESC

  s.homepage = 'https://github.com/lanligang/ChartView'

  s.authors  = { 'zuozheming' => [email protected]' }

  s.source   = { :git => 'https://github.com/lanligang/ChartView.git', :tag => s.version }

  s.source_files = 'ChartView/**/*.{h,m}'
  s.requires_arc = true
  s.ios.deployment_target = '7.0'
  s.ios.frameworks = ['UIKit', 'CoreGraphics', 'Foundation']
end

可以使用 pod "ChartView"
如果找不到请用 pod repo update 命令 更新本地仓库

仓库地址