Skip to main content

fastlane

Fastlane实战(一):移动开发自动化之道 - 简书.pdf Fastlane实战(一):移动开发自动化之道

Fastlane实战(二):Action和Plugin机制 - 简书.pdf Fastlane实战(二):Action和Plugin机制

Fastlane实战(四):自动化测试篇 - 简书.pdf Fastlane实战(四):自动化测试篇

Fastlane实战(五):高级用法 - 简书.pdf Fastlane实战(五):高级用法

iOS 持续交付之 Fastlane.pdf

Github Fastfiles-知乎的文件官方示例

手动解析本地证书 fastlane之使用match同步证书和配置文件 使用fastlane match自动和手动管理证书

#

建议使用:依赖现有证书支持 fastlane match#

手动配置证书方式一#

1. 查询 cer_id#

每个证书文件都有特定的 ID,推送之前我们还需要修改加密证书的文件名。该 ID 在开发者网站证 详情那一页的网址最后面展示。就是下面码糊住的那一块 image.png

2. ation#

require 'match'
git_url = './../gitrepo/.git'shallow_clone = falsebranch = 'master'ENV["MATCH_PASSWORD"] = 'yfsb'    default_platform(:mac)     platform :mac do        desc "Encrypt git"    lane :test do          UI.success "Encrypting git!"        storage = Match::Storage.for_mode("git", { git_url: git_url, shallow_clone: shallow_clone, git_branch: branch, clone_branch_directly: true})          storage.download        encryption = Match::Encryption.for_storage_mode("git", { git_url: git_url, working_directory: storage.working_directory})        encryption.decrypt_files        files_to_commit = Dir[File.join(storage.working_directory, "**", "*.{cer,p12,mobileprovision}")]        if files_to_commit.count > 0 # && !params[:readonly]          password = "#{ENV["MATCH_PASSWORD"]}"          ncryption.clear_password          encryption.store_password(password)          encryption.encrypt_files          #files_to_commit = Dir[File.join(storage.working_directory, "**", "*.{cer,p12,mobileprovision}")]          storage.save_changes!(files_to_commit: files_to_commit)        end    end end

参考链接 手动加密/解密存储库 fastlane手动解析 使用Fastlane与现有证书匹配,而不撤销它们 使用现有的证书创建/修改fastlane match证书库

手动配置证书方式二#

1. 查询 cer_id#

每个证书文件都有特定的 ID,推送之前我们还需要修改加密证书的文件名。该 ID 在开发者网站证 详情那一页的网址最后面展示。就是下面码糊住的那一块 image.png

2. 加密证书#

从Apple Developer中下载现有的证书及mobileprovision文件,将证书导入到钥匙中,并生成p12文件。得到的证书和配置文件还不能被match识别,需要通过加密命令加密后才符合match的验证要求,其中使用到的命令有:

2.1 加密证书#

  • openssl pkcs12 -nocerts -nodes -out key.pem -in {证书}.p12 :生成 pem 文件
  • openssl aes-256-cbc -k {密码} -in key.pem -out {cert_id}.p12 -a:生成加密后的 p12
  • openssl aes-256-cbc -k {密码} -in {证书}.cer -out {cert_id}.cer -a :生成加密后的证书,其中 cer_id,是第一部获取的 id

2.2 加密配置文件#

  • 配置文件起名需要符合规则 {Development/ADHoc/AppStore/InHouse}_bundleId.mobileprovision
  • openssl aes-256-cbc -k {密码} -in xxxx.mobileprovision -out Development_bundlleId.mobileprovision -a

3. 将加密好的证书和配置文件放到对应目录中,并提交上传仓库#

pod 相关#

一行命令发布 Pod 框架

iOS 组件化开发(四):fastlane实现pod自动化