pod help-->查看pod命令的帮助
pod search --> Search for pods(搜索pod)
pod trunk --> Interact with the CocoaPods API (e.g. publishing new specs) 上传source到trunk
pod spec --> Manage pod specs//管理pod spec
pod install -->Install project dependencies according to versions from a Podfile.lock //安装项目中的依赖项目
pod update -->Update outdated project dependencies and create new Podfile.lock//跟新依赖项目并且更新Podfile.lock
pod init -->Generate a Podfile for the current directory//创建pod file文件
复制代码
//注GKFramework.podspec是你的框架名称
pod spec create GKFramework.podspec
复制代码
然后编辑podspec文件。如下GKFramework.podspec
Pod::Spec.new do |s|s.name = "GKFramework" //定义名称s.version = "0.0.5" //tag版本s.summary = "A Sample.so you can use it" //简介,以后search到简介s.description = <<-DESCthis is gk framework, use it fortest your framework. we can use it as framework.DESC
//s.description 定义具体的描述s.homepage = "https://github.com/wongstar/GKFramework"s.license = { :type => "MIT", :file => "LICENSE" }//具体licenses.author = { "wongstar" => "wongstar.iac@gmail.com" }s.platform = :ios, "8.0"//build的平台s.ios.deployment_target = "7.0"//最低开发s.source = { :git => "https://github.com/wongstar/GKFramework.git", :tag => "#{s.version}" }s.source_files = 'Classes/**/*'#s.public_header_files='GKFramework/Classes/**/*.h'end复制代码
s.description = <<-DESCthis is gk framework, use it fortest your framework. we can use it as framework.DESC
s.description定义了描述该pod是用来做什么的。注意这里的写法复制代码
source file没找到 [iOS] file patterns: The source_files pattern did not match any file. 确保你的source file是否配置正确,如你的spec目录和source对应的关系
cocoapods环境问题 unknown: Encountered an unknown error (Simulator iPhone 4s is not available.) during validation 执行下面命令
sudo gem install cocoapods --pre
复制代码
如果执行上面的有问题出现 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/xcodeproj 执行下面命令
sudo gem install -n /usr/local/bin cocoapods
复制代码
Swift 版本问题 [!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a .swift-version file to set the version for your Pod. For example to use Swift 2.3, run:
echo"2.3" > .swift-version.
复制代码
验证失败,会出现一系列错误,但也不是无根可寻,其中出现错误频率最多的提示是
source files没找到 ERROR | [iOS] file patterns: The source_files pattern did not match any file.
pod search GKFramework 搜索不到 Unable to find a pod with name, author, summary, or description matching GKFramework. 解决办法: 1.pod install --repo-update 2.或者全部删除:使用命令:rm ~/Library/Caches/CocoaPods/search_index.json 重新search GKFramework
文章目录 Linux 概述 什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使…
2017.10.23 iPhone X 的刘海为什么这么丑? 如果乔布斯在的话就一定不会允许这样的产品交付给用户么? 作为 iOS 开发人员该对 Apple 有怎样的认识? Apple 未来的发展的大方向是什么? 倘若没有 Apple 的存在,我想各位现在…