fix(ios): let the watch companion build for the simulator without a team - #11817
Conversation
A contributor with no Apple developer account couldn't run the app on
the iOS simulator, even though the simulator is normally the
account-free on-ramp — the watch companion target requires a team even
for a simulator destination:
Error (Xcode): No Account for Team "9536L8KLMP". Add a new account...
Error (Xcode): No profiles for '...development.watchapp' were found
Root-caused with `-showBuildSettings` and the real build log's tool
invocations, not guessed. Two hypotheses were tested and ruled out
first:
- A missing watchOS simulator runtime looked promising (this machine
had none installed) but was disproven with a clean rebuild after
installing the runtime and pairing a watch simulator to the test
device — the watch target's resolved SDKROOT was still the *device*
WatchOS SDK, confirmed both via `-showBuildSettings` and the
`ExecuteExternalTool ... -isysroot .../WatchOS.platform/...` lines in
the actual build log.
- An `Base.xcconfig`-level `CODE_SIGNING_ALLOWED[sdk=*simulator*] = NO`
override (an earlier attempt) never matched anything, for the same
reason: the watch target's own resolved SDK isn't a simulator SDK
even when the overall scheme destination is a simulator, so an
SDK-qualified condition can't distinguish this build from a genuine
device build.
Since Runner and the widget already build for the simulator without a
signing identity, and the watch companion target is `SKIP_INSTALL =
YES` (it is only ever embedded in Runner.app, never independently
installed), disabling signing specifically for its dev-flavor
configurations is safe: it does not touch Runner's or the widget's
signing at all, and does not affect prod/beta, where the watch app may
still need real signing for distribution.
Verified live and reproducibly: a fully clean `xcodebuild` (cleared
DerivedData) using the exact invocation `flutter run` produces
succeeded, and the real `flutter run --flavor dev -d <simulator>`
reached `Launching lib/main.dart on iPhone 17 Pro in debug mode...`
with the same team (9536L8KLMP) this machine has no account for.
No automated test: this is an Xcode project-settings fix with no
Linux-CI-reachable seam (`Dart Analyze & Tests` runs on Ubuntu, where
Xcode does not exist), consistent with how BasedHardware#7641's signing changes
were verified — manually, on macOS, with a real build.
Failure-Class: none
Fixes BasedHardware#11776.
|
All CI checks are green and this is ready for maintainer review/merge — I don't have write access to merge it myself. Summary: the watch companion target ( |
…ibutable Upstream BasedHardware#11817 set CODE_SIGNING_ALLOWED = NO on the watch companion's dev-flavor configurations so a contributor with no Apple account can run the app on the simulator. Its reasoning assumed nobody archives the dev flavor for a device, which is true upstream and not true here: this workflow builds --flavor dev because local_dev is the only profile that accepts this fork's own Firebase project. The result was an unsigned watch app embedded in a signed parent, which the archive rejects with "Embedded binary is not signed with the same certificate as the parent app." Only Release-dev is re-enabled. Debug-dev and Profile-dev keep upstream's behaviour, so the account-free simulator on-ramp BasedHardware#11817 exists for is untouched — including for us. Fork-only. This must never go upstream: there it would undo BasedHardware#11817 for the contributors it was written for.
Summary
A contributor with no Apple developer account couldn't run the app on the iOS simulator — normally the account-free on-ramp — because the watch companion target (
omiWatchApp) requires a development team even for a simulator destination:Root cause
Root-caused with
-showBuildSettingsand the real build log's tool invocations, not guessed. Two hypotheses were tested and ruled out first:SDKROOTwas still the device WatchOS SDK, confirmed both via-showBuildSettingsand theExecuteExternalTool ... -isysroot .../WatchOS.platform/...lines in the actual build log.Base.xcconfig-levelCODE_SIGNING_ALLOWED[sdk=*simulator*] = NOoverride (an earlier attempt) never matched anything, for the same reason: the watch target's own resolved SDK isn't a simulator SDK even when the overall scheme destination is a simulator, so an SDK-qualified condition can't distinguish this build from a genuine device build.Fix
Since Runner and the widget already build for the simulator without a signing identity, and the watch companion target is
SKIP_INSTALL = YES(it's only ever embedded inRunner.app, never independently installed), disabling signing specifically for its dev-flavor configurations is safe:Testing
No automated test — this is an Xcode project-settings fix with no Linux-CI-reachable seam (
Dart Analyze & Testsruns on Ubuntu, where Xcode doesn't exist), consistent with how #7641's signing changes were verified: manually, on macOS, with a real build.Verified live and reproducibly, from a fully clean
DerivedData:xcodebuildusing the exact invocationflutter runconstructs (-allowProvisioningUpdates -allowProvisioningDeviceRegistration -workspace ... -scheme dev -destination id=<simulator>) →** BUILD SUCCEEDED **.flutter run --flavor dev -d <simulator>→Launching lib/main.dart on iPhone 17 Pro in debug mode...— no signing errors, with the exact same team (9536L8KLMP) this machine has no account for.Failure-Class: none
Fixes #11776.