fastlane

生成证书+profile

  1. 找个空目录,执行 fastlane init 生成fastlane初始化配置文件
  2. 打开 fastlane/Fastfile 文件
  3. 注意,在执行第四步的脚本前,需要先解锁钥匙串,否则证书不能正常放入git中.解锁钥匙串脚本:security unlock-keychain -p "your password" ~/Library/Keychains/login.keychain
  4. 直接替换成以下内容(具体参数自己修改即可),然后执行fastlane create即可生成 证书+bundleid—+profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
default_platform(:ios)

def createBundleIds

  # 要创建的bundle id
  bundlesId = Array['com.XXX.XXXX']
  # 对应bundles的 appName
  appsName = Array['XXX']
  # apple 用户名
  appstore_username = 'XXXX@gmail.com'
  # 当账号加入了多个组织的时候需要填写(对应开发者中心的team name)
  appstore_team_name = 'XXXXXXXXX., Ltd.'
  # cer要保存在的git地址
  cer_git_url = 'git@git.XXX.com:XXX/XXX.git'
  # 证书保存的分支
  cer_git_branch = 'dev'
  # 生成什么类型的profile(can be appstore, adhoc, enterprise or development)
  gen_type = 'enterprise'

  bundlesId.each_with_index{ |bundleId,index|
    produce(
      username: appstore_username,
      app_identifier: bundleId,
      app_name: appsName[index],
      team_name: appstore_team_name,
      # true 表示 不创建 apple connect 应用
      skip_itc: true
    )

    match(
      type:gen_type,
      team_name: appstore_team_name,
      app_identifier:bundleId,
      git_url:cer_git_url,
      username: appstore_username,
      git_branch:cer_git_branch,
    )
  }
end

platform :ios do
  desc "Description of what the lane does"
  lane :create do
    createBundleIds
  end
end


--EOF--

若无特别说明,本站文章均为原创,转载请保留链接,谢谢