Automatic code signing management with Bazel

154 Views Asked by At

How can I use automatic code signing management in iOS project which uses automatic code sign management? The only way I see local_provisioning_profile rule apple_rules repo. Does Bazel have support for automatic code sign at all?

1

There are 1 best solutions below

0
Krypt On

Turns out, this configuration only generates valid xcode project file, but the app itself is not signed correctly. It currently isn't supported by rules_apple, apparently?

old answer:

  • ensure you are using latest version of rules_xcodeproj (1.12.1 at moment of the writing this message)
  • in your BUILD.bazel file:
load("@rules_xcodeproj//xcodeproj:defs.bzl", 
    "top_level_target",
    "xcodeproj",
    "xcode_provisioning_profile",
)

load("@build_bazel_rules_apple//apple:apple.bzl", 
    "local_provisioning_profile")


ios_application(
    <..>
    provisioning_profile = ":xcode_profile",
    <..>
)


local_provisioning_profile(
    name = "the_profile",
    profile_name = "<profile name>",
    team_id = "<team_id>",
)

xcode_provisioning_profile(
   name = "xcode_profile",
   team_id = "<team_id>",
   managed_by_xcode = True,
   provisioning_profile = ":the_profile",
)