mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-10 02:16:45 +08:00
The remedy documented in apps/mobile/README.md for a claimed bundle identifier — export EXPO_BUNDLE_IDENTIFIER_PROD, then re-run `pnpm ios:mobile:device:prod:release` — has no effect after the first build. `expo run:ios` prebuilds only when ios/ is missing: ensureNativeProjectAsync in @expo/cli returns early when the directory exists, so config plugins never re-run and the project keeps the old identifier. The same freeze hides every other app.config.ts change. A checkout whose ios/ was generated once still had the template bundle id, an empty AppIcon.appiconset, no CFBundleDisplayName, no CFBundleURLTypes and no NSPhotoLibraryUsageDescription — while every build reported success. Route every ios:* script through scripts/ios-run.sh, which prebuilds before running. The wrapper inherits the caller's dotenv/cross-env so prebuild and run resolve the same APP_ENV and bundle identifier; a bare prebuild in a prod/staging script would rewrite the project to the dev variant. --no-install is safe because run:ios installs pods itself when Podfile.lock is stale. --clean is avoided because expo-build-properties sets buildReactNativeFromSource, making a clean prebuild far too slow for the edit/run loop. scripts/ios-run.test.sh stubs pnpm on PATH and asserts the call sequence: prebuild precedes run:ios, arguments forward to run:ios only, and a failed prebuild aborts before run:ios. It runs in mobile's existing test task. Claude-Session: https://claude.ai/code/session_01GfpPip2LPR1y9bKKEssGLG Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
24 lines
1.2 KiB
Bash
Executable File
24 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build and run the iOS app, re-applying app.config.ts to ios/ first.
|
|
#
|
|
# `expo run:ios` only prebuilds when ios/ is missing (ensureNativeProjectAsync
|
|
# in @expo/cli): when the directory already exists it returns early and config
|
|
# plugins are never re-applied. Everything driven by app.config.ts — app icon,
|
|
# bundle identifier, display name, URL scheme, Info.plist permission strings —
|
|
# then stays frozen at whatever the first prebuild produced, while the build
|
|
# still reports success.
|
|
#
|
|
# ios/ is gitignored and fully generated, so prebuilding on every run is safe
|
|
# and idempotent. --no-install is fine because run:ios installs pods itself
|
|
# when Podfile.lock is out of date; --clean is deliberately avoided since
|
|
# expo-build-properties sets buildReactNativeFromSource, making a from-source
|
|
# pod rebuild far too slow for the normal edit/run loop.
|
|
#
|
|
# APP_ENV and the .env file are supplied by the calling package.json script, so
|
|
# prebuild and run resolve the same variant. Arguments are forwarded to
|
|
# run:ios only — prebuild takes the same flags for every variant.
|
|
set -euo pipefail
|
|
|
|
pnpm exec expo prebuild -p ios --no-install
|
|
exec pnpm exec expo run:ios "$@"
|