How to automatically set a signing command in an iOS cordova project?

I am trying to automate the assembly / deployment of my hybdrid mobile app in Jenkins using fastlane. I use ionic (v3.3.0) and cordova (v7.0.1) for the source. I am using fastlane v2.36.0, and Xcode is version 8.3.2.

The command that I run in 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

The team fastlane ios builddoes not work in the simulator team with an error

Code signing is required for the product type "Application" in the SDK "iOS" 10.3 '

Detailed error in fastlane log

"awesomeproject" . . "" SDK "iOS" 10,3'

xcode, Cordova, , . , , - Xcode /ios. , , XCode.

Fastlane ? , script. , . update_project_team .

+4
1

build.json Team ID , :

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}",
      "developmentTeam": "{your Team ID}",
      "packageType": "app-store"
    }
  }
}

, CLI Cordova, .

: Cordova Xcode 8 iOS 10, GUID , , , , Cordova v7.0.1.

+5

Source: https://habr.com/ru/post/1678543/


All Articles