Add git-ignored Signing.local.xcconfig plumbing for iOS archive signing
Co-authored-by: premnirmal <1255689+premnirmal@users.noreply.github.com>
This commit is contained in:
co-authored by
premnirmal
parent
691d0acf58
commit
e2218060d2
@@ -34,6 +34,9 @@ iosApp/.xcode.env.local
|
||||
# Local, git-derived version override written by iosApp/version.sh (optionally
|
||||
# #included by the committed iosApp/Version.xcconfig)
|
||||
iosApp/Version.local.xcconfig
|
||||
# Local, machine-specific code-signing team override (git-ignored) layered on
|
||||
# top of the committed iosApp/Signing.xcconfig for signed `xcodebuild archive`
|
||||
iosApp/Signing.local.xcconfig
|
||||
#iOS Firebase config (optional, prod only)
|
||||
iosApp/GoogleService-Info.plist
|
||||
iosApp/iosApp/GoogleService-Info.plist
|
||||
|
||||
@@ -168,6 +168,42 @@ signing secrets are needed). Producing a signed `.ipa` for TestFlight/App Store
|
||||
out of scope for this gate — that requires code-signing certificates/profiles supplied as encrypted
|
||||
secrets (or fastlane match) and an `xcodebuild archive`/`-exportArchive` (or `fastlane`) step.
|
||||
|
||||
### Code signing (for `xcodebuild archive`)
|
||||
|
||||
The simulator builds above pass `CODE_SIGNING_ALLOWED=NO`, so they need no signing identity. An
|
||||
`archive`, however, builds the **Release** configuration, which **must** be code-signed — with
|
||||
automatic signing that requires a **Development Team**, otherwise the archive fails with:
|
||||
|
||||
```
|
||||
error: Signing for "StocksWidget" requires a development team. Select a development team in the
|
||||
Signing & Capabilities editor. (in target 'StocksWidget' from project 'StocksWidget')
|
||||
```
|
||||
|
||||
A Team ID is personal, so it is **not** committed. The committed
|
||||
[`iosApp/Signing.xcconfig`](Signing.xcconfig) (read by every target via `Version.xcconfig`) sets
|
||||
`CODE_SIGN_STYLE = Automatic` and optionally includes the git-ignored `iosApp/Signing.local.xcconfig`.
|
||||
Set your team there once (no `xcodegen generate` needed — it is read at build time):
|
||||
|
||||
```sh
|
||||
echo 'DEVELOPMENT_TEAM = ABCDE12345' > iosApp/Signing.local.xcconfig
|
||||
```
|
||||
|
||||
Find your 10-character Team ID in the [Apple Developer portal](https://developer.apple.com/account)
|
||||
under *Membership*, or via `security find-identity -v -p codesigning`. You must also be signed into
|
||||
that Apple Developer account in Xcode (*Settings → Accounts*) so automatic signing can issue the
|
||||
provisioning profiles. Then:
|
||||
|
||||
```sh
|
||||
xcodebuild -project iosApp/StockTicker.xcodeproj \
|
||||
-scheme StocksWidget \
|
||||
-configuration Release \
|
||||
-archivePath build/StockTicker.xcarchive \
|
||||
archive
|
||||
```
|
||||
|
||||
Alternatively, skip the local file and pass the team on the command line
|
||||
(`xcodebuild ... archive DEVELOPMENT_TEAM=ABCDE12345`).
|
||||
|
||||
### Firebase (optional, prod only)
|
||||
|
||||
Firebase is optional. The FirebaseAnalytics / FirebaseCore SDK is wired into the `iosApp` target as a
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code-signing configuration, applied to every target via the project's base
|
||||
// `configFiles` (Version.xcconfig #includes this file, which Xcode reads at
|
||||
// build time — so no `xcodegen generate` is needed for a change here to take
|
||||
// effect).
|
||||
//
|
||||
// `archive` builds the Release configuration, which — unlike the simulator
|
||||
// builds used by `run`/CI (`CODE_SIGNING_ALLOWED=NO`) — MUST be code-signed.
|
||||
// Automatic signing then requires a DEVELOPMENT_TEAM, otherwise xcodebuild fails
|
||||
// with:
|
||||
// error: Signing for "StocksWidget" requires a development team. Select a
|
||||
// development team in the Signing & Capabilities editor.
|
||||
//
|
||||
// A team ID is personal/machine-specific, so it is deliberately NOT committed
|
||||
// here. Set it once in the git-ignored `Signing.local.xcconfig` (layered on top
|
||||
// via the optional include below), e.g.:
|
||||
//
|
||||
// echo 'DEVELOPMENT_TEAM = ABCDE12345' > iosApp/Signing.local.xcconfig
|
||||
//
|
||||
// (Find your 10-character Team ID in the Apple Developer portal under
|
||||
// Membership, or via `security find-identity -v -p codesigning`.) Both the app
|
||||
// and its widget extension pick it up, so a signed `xcodebuild archive`
|
||||
// succeeds. Alternatively, pass it on the command line without any local file:
|
||||
//
|
||||
// xcodebuild ... archive DEVELOPMENT_TEAM=ABCDE12345
|
||||
//
|
||||
CODE_SIGN_STYLE = Automatic
|
||||
|
||||
// Optional machine-local override that sets DEVELOPMENT_TEAM (git-ignored). The
|
||||
// `?` makes the include optional, so builds that do not need signing (e.g. the
|
||||
// simulator build with CODE_SIGNING_ALLOWED=NO) still succeed when it is absent.
|
||||
#include? "Signing.local.xcconfig"
|
||||
@@ -22,3 +22,9 @@ CURRENT_PROJECT_VERSION = 1
|
||||
// Optional machine-local override written by version.sh (git-ignored). The `?`
|
||||
// makes the include optional, so builds still succeed when it is absent.
|
||||
#include? "Version.local.xcconfig"
|
||||
|
||||
// Code-signing configuration (CODE_SIGN_STYLE + an optional git-ignored
|
||||
// DEVELOPMENT_TEAM override). Kept in a separate committed file, but included
|
||||
// here because Version.xcconfig is the single base `configFiles` entry Xcode
|
||||
// reads for every target — see Signing.xcconfig for details.
|
||||
#include "Signing.xcconfig"
|
||||
|
||||
Reference in New Issue
Block a user