微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在IOS cordova项目上自动设置签名团队?

我正在尝试使用fastlane在Jenkins中自动构建/部署我的hybdrid移动应用程序.
我使用ionic(v3.3.0)和cordova(v7.0.1)作为来源.我使用fastlane v2.36.0,Xcode是版本8.3.2.

我在jenkins工作中运行的命令

yarn
ionic cordova prepare
fastlane ios build

fastlane / FastFile

platform :ios do
  before_all do
  end

  ios_project_path = "platforms/ios/awesomeproject.xcodeproj"

  desc "Build for IOS"
  lane :build do
    increment_build_number(
      xcodeproj: ios_project_path,build_number: ENV["BUILD_NUMBER"]
    )

    # Recreate schemes to ensure a smooth transition from cordova to gym
    recreate_schemes(project: ios_project_path)

    update_project_team(
      path: ios_project_path,teamid: "TEAMID"
    )

    #update_provisioning_profile_specifier(xcodeproj: ios_project_path)


      gym(scheme: "awesomeproject",configuration: "Debug",clean: true,project: ios_project_path,output_directory: "target")
  end
end

fastlane / Appfile

package_name "com.xxx.awesomeapp"

app_identifier "com.xxx.awesomeapp" # The bundle identifier of your app
apple_id "xxx.xxxx@xxx.com" # Your Apple email address

team_id "TEAMID" # Developer Portal Team ID

fastlane ios build命令在健身指令上失败了

Code signing is required for product type ‘Application’ in SDK ‘iOS
10.3’

fastlane日志中的详细错误

Check dependencies Signing for “awesomeproject” requires a development
team. Select a development team in the project editor. Code signing is
required for product type ‘Application’ in SDK ‘iOS
10.3’

Cordova生成的xcode项目已激活自动签名,但缺少签名团队.
到目前为止我使用的解决方法是在第一次生成platform / ios文件夹时手动选择Team with Xcode.但是如果我删除了cordova生成的平台文件夹,我需要重新选择XCode中的团队.

有没有办法选择Cordova或签名团队的任何fastlane插件?我愿意使用任何解决方案,脚本.
所以我的构建将完全自动化. update_project_team指令不起作用.

解决方法

在项目的根目录中创建一个名为build.json的文件,其中包含要用于对应用程序进行签名的Team ID和配置文件GUID:

build.json:

{
  "ios": {
    "debug": {
      "codeSignIdentity": "iPhone Developer","provisioningProfile": "{your development profile}","developmentTeam": "{your Team ID}","packageType": "development"
    },"release": {
      "codeSignIdentity": "iPhone distribution","provisioningProfile": "{your distribution profile}","packageType": "app-store"
    }
  }
}

然后,使用Cordova CLI构建时,将使用这些签名凭据.

注意:根据Cordova documentation,Xcode 8和iOS 10不推荐使用上述语法,不再需要配置文件GUID.但是,如果没有使用Cordova v7.0.1指定配置文件,我就无法使其工作.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐