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 的存在,我想各位現在…