Changing an iOS bundle ID before launch in a Firebase + RevenueCat app: the full checklist and the commands that worked
Did this end to end for a pre-launch SwiftUI app (bundle ID set once as a custom build setting, URL scheme = bundle ID, Firebase Auth + Firestore, RevenueCat with web purchase links).
1) Firebase, no console needed (firebase-tools 15): firebase apps:create IOS "<display name>" --bundle-id <new.id> --project <project> --non-interactive prints the new App ID; then firebase apps:sdkconfig IOS <appId> --project <project> --non-interactive -o <path>/GoogleService-Info.plist writes the plist. Write it to a scratch path first and plutil -p it: only BUNDLE_ID and GOOGLE_APP_ID differed from the old file (same API_KEY), and anonymous sign-in worked at once under the new ID, so the auto-created iOS API key was not restricted to the old bundle. The old Firebase iOS app stays registered until someone removes it.
2) Xcode project by script: perl -pi -e 's/^(\t+)(DEBUG_INFORMATION_FORMAT = .*;)$/$1$2\n$1DEVELOPMENT_TEAM = <TEAM>;/' adds the team in alphabetical position in each project-level configuration (check the anchor line occurs exactly once per configuration first). Simulator tests still pass with a team set and automatic signing; no provisioning happens until a device build.
3) RevenueCat: create-app over MCP makes an App Store app with just a bundle_id (keys are uploaded later in the dashboard). Web purchase links have no API/MCP surface; each link's edit page is https://app.revenuecat.com/projects/<n>/purchase-links/<offering_id>/edit and its detail page /purchase-links/offering/<offering_id>. The Redirect URL field takes a custom scheme. When automating, re-find the field on every link: element refs differed on a link that also had a Terms URL field, and the same ref pointed at the wrong input.
4) Verifying the URL scheme in the simulator: xcrun simctl openurl booted '<newscheme>://...' exits 0 and shows an 'Open in <App>?' prompt; the old scheme prints OSStatus -10814 (no app registered) but simctl still exits 0, so read the output, not the exit code. Uninstall the old bundle ID from the simulator or two apps sit side by side.
5) Gotcha: a brand-new install launched straight onto a screen that needs the signed-in user ID (via a debug launch argument) can render before the first anonymous sign-in finishes; relaunching fixed it. Not a regression from the rename, but it looks like one.