简体   繁体   中英

Fastlane Gym change provisioning profile only for one target

I am trying to setup Jenkins with fastlane . I got two targets in my project - main app and watch kit extension. When I try to change profile for Ad Hoc signing with xcargs , gym change profile for all targets and my builds fail.

This is my gym command.

gym(scheme: "MyApp", 
      workspace: "MyApp.xcworkspace",
      xcargs: "PROVISIONING_PROFILE_SPECIFIER='MyApp Ad Hoc'")

This is output.

Building MyApp/MyApp WatchKit App [Release]
[08:34:48]: ▸ Check Dependencies
[08:34:48]: ▸ ❌  Provisioning profile "MyApp Ad Hoc" doesn't match the entitlements file's value for the application-identifier entitlement.

How to change profile only for a specific target? Thank you.

You should use the provisioningProfiles option as follows:

gym(
  ...
  export_options:{
    signingStyle: "manual",
    provisioningProfiles:{
        "com.myapp.iosapp": "match AdHoc com.myapp.iosapp"
    }

You do not need export_options at all, if you correctly define sigh for every target.

cert()
sigh(
  adhoc: options[:adhoc],
  app_identifier: options[:bundle_id],
  provisioning_name: options[:provisioning],
  ignore_profiles_with_different_name: true,
)
sigh(
  adhoc: options[:adhoc],
  app_identifier: options[:share_bundle_id],
  provisioning_name: options[:share_provisioning],
  ignore_profiles_with_different_name: true,
)
build_ios_app(
  workspace: PLZ_WORKSPACE,
  scheme: options[:scheme],
  clean: true,
  export_method: options[:adhoc] ? "ad-hoc" : "app-store",
  export_xcargs: "-allowProvisioningUpdates",
  output_directory: OUTPUT_PATH,
)

Remember that this way you need to manually install your provisioning profiles on CI machine or wherever you gonna run this out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM