bazelbuild / bazelbuild/rules_apple

application-identifier entitlement in Simulator

Open
#106 11 comments 0 reactions 0 assignees View on GitHub
P3 type: feature request
Dominant language
Starlark
Stars
593
Forks
334
Avg merge
16h 48m
Merged PRs (30d)
9

Description

#63 describes how entitlements are not applied unless a provisioning profile is set. To an extent, this is an expected behavior as some entitlements require replacing variables like `$(AppIdentifierPrefix)` which require a provisioning profile in order to get that value.

This gets a little trickier with Simulator builds as they do not explicitly require entitlements or a provisioning profile in order to build. When building with Xcode 8 targeting iOS 10 Simulator, Xcode will always add the `application-identifier` entitlement regardless of your entitlement settings. This entitlement seems to be required to use certain APIs, for instance the Keychain API via `Security.framework`.

I've created a workaround that wraps `ios_application` and adds a `__entitlements` text segment with a blank value for `application-identifier` when the value for `provisioning_profile` is not set. This seems to work to make those APIs available again, but I'm not sure how sound of a solution it is or if it may cause other problems.

Perhaps this is a thing that the bazel apple rules should do automatically to give it more parity with how Xcode does simulator builds?

Contributor guide

Open the contributing guide

Research direction

Start by reading issue #63 and the ios_application behavior described here, then reproduce an Xcode 8 iOS 10 Simulator build with and without a provisioning profile. Compare the generated entitlements, especially application-identifier, and verify whether the proposed blank value restores Security.framework Keychain access without affecting other builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios
Domain
mobile-dev, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.