一.证书
一个证书是一个公钥加上许多信息,这些信息时被机构进行签名认证的。
对ios开发来说,一般会有两个证书,一个是iPhone developer,另一个是iPhone distribution,前者可以使应用在你的测试设备上运行,后者是提交到app store用
mac上创建一对公私钥,公:A,私:B
苹果有自己固定的一对公私钥,公:C,私:D
把公钥A上传到苹果后台,用苹果后台的私钥D去签名公钥A,得到一份包含了公钥A已经其签名,把这份数据叫做证书
开发时,编译一个app后,用本地的私钥B对这个APP进行签名,同时把第三方证书一起打包进APP,安装到手机上
在安装时,ios系统取得证书,通过系统内置的公钥c,去验证签名是否正确
验证证书后确保了公钥A是苹果认证的,再用公钥A去验证app的签名
二.打包过程
1)运行pod install报错
2)需要安装cocoapods(CocoaPods 为你的项目管理 lib 的依赖。cocoaPods 的使用时基于 Gem 的。CocoaPods应该是iOS最常用最有名的类库管理工具)
sudo gem install cocoapods(需要翻墙)
3)运行pod install报错:AML safe loading is not available.Please upgrade psych to version that suppo
4)运行:rvm install xxx报错:rvm: command not found
5)source ~/.rvm/scripts/rvm 输入这个报:No such file or directory
6)使用rvma安装ruby: curl -L get.rvm.io | bash -s stable(安装好rvm-Ruby版本管理器)
再运行source ~/.bashrc source ~/.bash_profile
6)安装ruby报错(rror running 'requirements_osx_brew_update_system ruby-2.5.0',
please read /Users/wgs1157/.rvm/log/1517625818_ruby-2.5.0/update_system.log
Requirements installation failed with status: 1.) 因Mac未安装Homebrew造成
7)安装homebrew:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
8)运行完后再安装rvm install 2.5.0报错:Failed to update Homebrew(Error running 'requirements_osx_brew_update_system ruby-2.5.0',
please read /Users/wgs1157/.rvm/log/1517626016_ruby-2.5.0/update_system.log
Requirements installation failed with status: 1.)
9)运行brew update报错(an't create update lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
sudo chown -R $(whoami) /usr/local/var/homebrew)
10)修改权限:sudo chown -R $(whoami) /usr/local
sudo chown -R $(whoami) $(brew --prefix)/*
11)brew update—success
12)rvm install 2.3.0—success
13)pod install报错(/Library/Ruby/Site/2.0.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'cocoapods' (>= 0) among 11 total gem(s) (Gem::MissingSpecError))(因为安装cocoapods是sudo安装导致)
14)sudo gem uninstall cocoapods
gem install cocoapods -V --no-ri --no-rdoc
pod setup(时间较长)
5.在项目中使用:cd到项目里
1)pod init (生成podfile文件)
2)pod install(运行后报错,查不到原因后再运行一次就好了。。。。)