常用命令整理
source link: https://xnxy.github.io/xnxy.github.io/2020/06/16/%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E6%95%B4%E7%90%86/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
常用命令整理
Overview
这篇文章主要是将常用的指令整理一下,便于后期的查阅。
这篇文章会不定时更新……
部署Framework到cocoapods
创建podsepc文件
cd <工程目录>
pod spec create MyFramework
编写podsepc文件
可以参考Podspec语法进行编写。
Pod::Spec.new do |spec|
spec.name = "ZVDynamicClipImage"
spec.version = "0.0.1"
spec.summary = "动态区域裁剪图片的iOS库"
spec.homepage = "https://github.com/xnxy/ZVDynamicClipImage.git"
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.author = { "拿根针尖对麦芒" => "[email protected]" }
spec.social_media_url = "https://xnxy.github.io"
spec.platform = :ios, "8.0"
spec.source = { :git => "https://github.com/xnxy/ZVDynamicClipImage.git", :tag => "#{spec.version}" }
spec.source_files = "ZVDynamicClipImage/ZVDynamicClipImage/ZVDynamicClipImage.h"
spec.subspec 'Private' do |specB|
specB.source_files = "ZVDynamicClipImage/ZVDynamicClipImage/Private/*"
end
spec.subspec 'Public' do |specC|
specC.source_files = "ZVDynamicClipImage/ZVDynamicClipImage/Public/*"
specC.dependency 'ZVDynamicClipImage/Private'
end
end
验证
podspec
格式是否正确
使用pod lib lint
验证podspec
文件格式是否正确。
pod lib lint MyFramework.podspec --verbose --allow-warnings
提交
podspec
文件
pod trunk push MyFramework.podspec
管理trunk账号
注册trunk账号
pod trunk register 你的邮箱 '用户名' --description='描述内容' (邮箱参数是必须的,用户名和--description参数可省略)
查看注册信息
pod trunk me
提交podspec文件
pod trunk push 文件名.podspec
将公共库的podspec文件部署到自己的私有库中
pod repo push REPO 文件名.podspec # REPO 私有索引库名
添加他人共同维护某库
pod trunk add-owner 公共库名 已注册trunk的邮箱地址
移除某个维护人员
pod trunk remove-owner 公共库名 已注册trunk的邮箱地址
移除已发的某个版本对应的工程信息
pod trunk delete 工程名 版本号
其他常用命令
查看pod版本及环境信息
pod env
引用某个私有库
source 'https://github.com/CocoaPods/Specs.git'
source 'https://gitee.com/xnxyonly1/ZVPrivate.git'
platform :ios, '9.0'
inhibit_all_warnings!
target 'ZVPrivateDemo' do
pod 'ZVPrivate', :git => 'https://gitee.com/xnxyonly1/ZVPrivate.git', :tag => '0.0.1'
end
更新本地缓存
pod cache clean --all
rm -rf ~/Library/Caches/CocoaPods
pod repo update
Mac软件无法安装时,可以对其重签名
有的软件安装到电脑上时会提示“……将对您的电脑造成伤害,您应该将它移到废纸篓”的提示。
可以对其进行重签名,先判断是否安装命令行工具xcode-select --version
如果未安装,使用xcode-select --install
指令进行安装,安装成功后执行下方指令对其进行重签名。
签名成功后重新打开即可。
codesign -f -s - --deep /Applications/软件名.app
安装与卸载cocoapods
VPN如果自动模式不行的话,切换都全局模式,选择美国的节点。
安装cocoapods:
sudo gem install cocoapods
指定安装cocoapods:
sudo gem install cocoapods -v 1.6.1
查看当前cocoapods版本:
pod --version
或
gem list
移除程序包:
sudo gem uninstall cocoapods
或指定某版本:
sudo gem uninstall cocoapods -v 1.9.1
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK