bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
512 stars 269 forks source link

`provisioning_profile_repository` / `local_provisioning_profile` is broken with Xcode 16 #2543

Closed kersson closed 1 month ago

kersson commented 1 month ago

With Xcode 16 the location of the Xcode-managed provisioning profiles changed from:

~/Library/MobileDevice/Provisioning\ Profiles

to:

~/Library/Developer/Xcode/UserData/Provisioning\ Profiles

which breaks provisioning_profile_repository used by local_provisioning_profile: https://github.com/bazelbuild/rules_apple/blob/08f5805de4d3333dbb0de90e8d2d18e4ba94ddd5/apple/internal/local_provisioning_profiles.bzl#L8-L9

Xcode uses profiles in the old location, but if a profile is updated (e.g. if registering a new device), then it is stored in the new location and isn't findable by local_provisioning_profile.

https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes#Signing--Distribution

  • Fixed: Xcode 16 stores downloaded provisioning profiles in a new location on disk, at ~/Library/Developer/Xcode/UserData/Provisioning Profiles. Xcode will still load previously downloaded profiles from the previous location. (54347894)

Workaround

mv ~/Library/MobileDevice/Provisioning\ Profiles/* ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles
rmdir ~/Library/MobileDevice/Provisioning\ Profiles
ln -s ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles ~/Library/MobileDevice/Provisioning\ Profiles