Cordova fastlane xcode 8 配置配置文件

Cordova fastlane xcode 8 configure profile

我尝试在 xcode 8 上通过 fastlane (https://github.com/platanus/fastlane-cordova) 构建我的应用程序 在生成 xcode.proj 时如何在 cordova 中指定 select "correct" 配置文件?

=== BUILD TARGET app OF PROJECT app WITH CONFIGURATION Release ===
[ios] 
[ios] Check dependencies
[ios] Signing for "Eule" requires a development team. Select a development team in the project editor.
[ios] Code signing is required for product type 'Application' in SDK 'iOS 10.0'
[ios] 
[ios] ** BUILD FAILED **
[ios] 
[ios] 
[ios] The following build commands failed:
[ios]   Check dependencies
[ios] (1 failure)
[ios] Error: Error code 65 for command

我遇到了同样的问题,所以我最终创建了一个 Cordova plugin for Fastlane 来解决这个问题。

查看this blog post或以下的使用方法:

使用 Cordova Fastlane 插件

Cordova Fastlane Plugin 添加到您的项目中:

fastlane add_plugin cordova

当被问到 Should fastlane modify the Gemfile at path 'Gemfile' for you? (y/n) 时,回复 y

然后您可以将插件集成到您的 Fastlane 设置中,例如:

platform :ios do
  desc "Deploy ios app on the appstore"

  lane :create do
    produce(app_name: "myapp")
  end

  lane :deploy do
    match(
      type: "appstore",
      git_url: "https://bitbucket.org/Almouro/certificates" # REPLACE WITH YOUR PRIVATE REPO FOR MATCH
    )
    cordova(platform: 'ios') # Using the Cordova Fastlane Plugin
    appstore(ipa: ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'])
  end
end

platform :android do
  desc "Deploy android app on play store"

  lane :deploy do
    cordova(
      platform: 'android',
      keystore_path: './prod.keystore', # REPLACE THESE LINES WITH YOUR KEYSTORE INFORMATION
      keystore_alias: 'prod',
      keystore_password: 'password'
    ) # Cordova Fastlane Plugin
    supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])
  end
end

带有 Appfile 例如

app_identifier "com.awesome.app"
apple_id "apple@id.com"
team_id "28323HT"

小菜一碟!

对于iOS、运行 fastlane ios create一次在开发者会员中心和iTunes Connect上创建您的应用程序。

现在,您只需 运行 fastlane ios deployfastlane android deploy 即可部署到商店!

从这里去哪里

  • 您可以在 Cordova 应用程序的根目录中通过 运行ning fastlane actions cordova 查看所有插件选项

  • Fastlane docs 很高兴了解它如何让您的生活更轻松

  • 如果您对插件有任何问题或改进想法,请告知他们here