diff --git a/apps/ios/fastlane/SETUP.md b/apps/ios/fastlane/SETUP.md index d7ab2bc7a..ef01db1f6 100644 --- a/apps/ios/fastlane/SETUP.md +++ b/apps/ios/fastlane/SETUP.md @@ -22,10 +22,11 @@ ASC_KEY_PATH=/absolute/path/to/AuthKey_XXXXXXXXXX.p8 IOS_DEVELOPMENT_TEAM=YOUR_TEAM_ID ``` +Tip: run `scripts/ios-team-id.sh` from the repo root to print a Team ID to paste into `.env`. + Run: ```bash cd apps/ios fastlane beta ``` - diff --git a/scripts/ios-team-id.sh b/scripts/ios-team-id.sh new file mode 100755 index 000000000..d7ae4ded4 --- /dev/null +++ b/scripts/ios-team-id.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +team_id="$(defaults read com.apple.dt.Xcode IDEProvisioningTeamIdentifiers 2>/dev/null | grep -Eo '[A-Z0-9]{10}' | head -n1 || true)" + +if [[ -z "$team_id" ]]; then + team_id="$(security find-identity -p codesigning -v 2>/dev/null | grep -Eo '\\([A-Z0-9]{10}\\)' | head -n1 | tr -d '()' || true)" +fi + +if [[ -z "$team_id" ]]; then + echo "No Apple Team ID found. Open Xcode or install signing certificates first." >&2 + exit 1 +fi + +echo "$team_id"