介绍

produce最典型的使用就是创建appid:

功能介绍:

  • Create new apps on both iTunes Connect and the Apple Developer Portal
  • Modify Application Services on the Apple Developer Portal
  • Create App Groups on the Apple Developer Portal
  • Associate apps with App Groups on the Apple Developer Portal
  • Support for multiple Apple accounts, storing your credentials securely in the Keychain

使用

创建新的应用:

fastlane produce

按提示输入Apple id 、AppId、App Name即可,随后将在Apple Dev Center创建好AppId了。

查看可执行的参数列表:

fastlane produce --help

开/关应用服务举例

命令 详情
fastlane produce enable_services –homekit –healthkit 开启应用服务,以homekit和healthkit为例
fastlane produce disable_services –icloud 关闭icloud服务为例
fastlane produce group -g group.krausefx -n “Example App Group” 创建一个app group
fastlane produce associate_group -a com.krausefx.app group.krausefx 将appid和app group关联

查看参数列表

查看开启/关闭服务的各种参数的列表

#开启
fastlane produce enable_services --help
#关闭
fastlane produce disable_services --help

环境变量

所有可用的值也可以使用环境变量传递,运行fastlane produce --help以获取所有可用参数的列表。

fastlane Integration

可以通过lane控制创建:

lane :release do
  produce(
    username: 'felix@krausefx.com',
    app_identifier: 'com.krausefx.app',
    app_name: 'MyApp',
    language: 'English',
    app_version: '1.0',
    sku: '123',
    team_name: 'SunApps GmbH' # only necessary when in multiple teams
    
    # Optional
    # App services can be enabled during app creation
    enable_services: {
      app_group: "on"               # Valid values: "on", "off"
      apple_pay: "on"               # Valid values: "on", "off"
      associated_domains: "on"      # Valid values: "on", "off"
      data_protection: "complete"   # Valid values: "complete", "unlessopen", "untilfirstauth"
      game_center: "on"             # Valid values: "on", "off"
      health_kit: "on"              # Valid values: "on", "off"
      home_kit: "on"                # Valid values: "on", "off"
      wireless_accessory: "on"      # Valid values: "on", "off"
      icloud: "cloudkit"            # Valid values: "legacy", "cloudkit"
      in_app_purchase: "on"         # Valid values: "on", "off"
      inter_app_audio: "on"         # Valid values: "on", "off"
      passbook: "on"                # Valid values: "on", "off"
      push_notification: "on"       # Valid values: "on", "off"
      siri_kit: "on"                # Valid values: "on", "off"
      vpn_configuration: "on"       # Valid values: "on", "off"
    }
  )

  deliver
end

想要在deliver中使用新生成的app,需要在Deliverfile加上这么一句:

apple_id ENV['PRODUCE_APPLE_ID']

它会告诉deliver,哪个App id会被使用,尽管这个app现在还不能在App Store上获取到。 您仍然必须填写剩余的信息(如屏幕截图,应用说明和定价)。 您可以使用交付使用CLI上传应用程序元数据。

参考

https://github.com/fastlane/fastlane/tree/master/produce