You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setup.sh ios builds an app that hangs on the splash screen when the local backend harness isn't running #11534
bash setup.sh ios builds, installs and launches an app that then hangs on the splash screen, with no error and no indication of the cause, whenever the local backend harness is not running.
Reproduced today on an iOS device build from current main. setup.sh ios (the non-beta branch, setup.sh:417-420) is the local-dev path: it writes
into app/.dev.env and passes --dart-define=OMI_FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1. With nothing listening on port 8000 the app waits on a backend that does not exist. The build itself succeeds, so every signal a contributor has says the setup worked.
127.0.0.1 is the phone's loopback, not the Mac's. Even with the harness running, a physical iOS device cannot reach it. setup.sh honours OMI_DEV_HOST (setup.sh:53) for exactly this, but nothing tells a contributor they need it or what to set it to.
Suggested shape, deliberately small: before building, check whether the configured API_BASE_URL is reachable, and if not, fail with a message naming the harness and the OMI_DEV_HOST override — rather than producing an app that looks fine and hangs. Failing fast is the whole point; the current behaviour spends a full iOS build before stranding the developer.
For context on why the local harness is the only option here: the prod-simulating path (setup.sh ios beta, targeting https://api.omiapi.com/) is gated behind FIREBASE_SERVICE_ACCOUNT_KEY and so is unavailable to community contributors by design. Production Firebase tokens are also rejected against that backend, so pointing a dev build at production yields a sign-in that appears to succeed while every call fails.
Found while verifying the iOS community-build signing work (#7641), which is unrelated to this and does not introduce it — this reproduces on main today.
Correcting my own framing. I filed this as "hangs when the local backend harness isn't running." That is not the real problem, and I don't want the title to send anyone down the wrong path.
I got the harness fully up tonight and the app still hangs on the splash screen. The reason is that nothing the harness starts is reachable from a physical device:
setup.sh ios writes API_BASE_URL=http://127.0.0.1:8000/ into app/.dev.env. On the phone, 127.0.0.1 is the phone's own loopback — not the Mac's. And the Mac's LAN address isn't listening, because the harness binds loopback only. So there is no address a device can be pointed at, and editing .dev.env or setting OMI_DEV_HOST cannot fix it.
That makes the accurate statement: the documented iOS setup path cannot reach the documented local backend from real hardware at all. The iOS Simulator is unaffected, since it shares the host's network stack — which is likely why this hasn't been hit before.
Worth considering, in rough order of cost:
a bind-host option on the harness (0.0.0.0) so OMI_DEV_HOST=<LAN IP> becomes meaningful
documenting a tunnel (ngrok/cloudflared) as the supported device story
having setup.sh ios detect a device target and warn that the loopback default won't reach it
Happy to send a PR for whichever direction maintainers prefer — I'd rather not guess at the intended architecture here.
Separately, while getting the harness up I hit two bugs that both present as the same misleading failure — a 135s wait ending in firestore: not healthy … auth: not healthy, which blames the wrong components. I have fixes and tests for both and will open a PR:
npx firebase-tools blocks on an install prompt._firebase_command() builds ["npx", "firebase-tools"]. Without firebase-tools installed, npx asks Ok to proceed? (y) — but the emulator runs detached with stdout redirected to a log file, so nothing can answer and it blocks forever. My entire firebase-emulators.log was that prompt, twice. --yes fixes it.
The java preflight passes on every Mac. The check is _which("java"), but macOS ships a stub at /usr/bin/java that is always present and exits 1 with "Unable to locate a Java Runtime" when no JDK exists. So shutil.which("java") returns a path regardless, the preflight passes, and the missing JVM only surfaces later as that same health-check timeout. Running java -version and checking the exit code distinguishes the stub from a real runtime.
With both fixed, make dev-up names the real blocker in ~2s instead of timing out after 135s against the wrong services.
Activity
formed2forge commentedon Aug 14, 2026
Correcting my own framing. I filed this as "hangs when the local backend harness isn't running." That is not the real problem, and I don't want the title to send anyone down the wrong path.
I got the harness fully up tonight and the app still hangs on the splash screen. The reason is that nothing the harness starts is reachable from a physical device:
setup.sh ioswritesAPI_BASE_URL=http://127.0.0.1:8000/intoapp/.dev.env. On the phone,127.0.0.1is the phone's own loopback — not the Mac's. And the Mac's LAN address isn't listening, because the harness binds loopback only. So there is no address a device can be pointed at, and editing.dev.envor settingOMI_DEV_HOSTcannot fix it.That makes the accurate statement: the documented iOS setup path cannot reach the documented local backend from real hardware at all. The iOS Simulator is unaffected, since it shares the host's network stack — which is likely why this hasn't been hit before.
Worth considering, in rough order of cost:
0.0.0.0) soOMI_DEV_HOST=<LAN IP>becomes meaningfulsetup.sh iosdetect a device target and warn that the loopback default won't reach itHappy to send a PR for whichever direction maintainers prefer — I'd rather not guess at the intended architecture here.
Separately, while getting the harness up I hit two bugs that both present as the same misleading failure — a 135s wait ending in
firestore: not healthy … auth: not healthy, which blames the wrong components. I have fixes and tests for both and will open a PR:npx firebase-toolsblocks on an install prompt._firebase_command()builds["npx", "firebase-tools"]. Without firebase-tools installed, npx asksOk to proceed? (y)— but the emulator runs detached with stdout redirected to a log file, so nothing can answer and it blocks forever. My entirefirebase-emulators.logwas that prompt, twice.--yesfixes it._which("java"), but macOS ships a stub at/usr/bin/javathat is always present and exits 1 with "Unable to locate a Java Runtime" when no JDK exists. Soshutil.which("java")returns a path regardless, the preflight passes, and the missing JVM only surfaces later as that same health-check timeout. Runningjava -versionand checking the exit code distinguishes the stub from a real runtime.With both fixed,
make dev-upnames the real blocker in ~2s instead of timing out after 135s against the wrong services.fix(dev-harness): name `make dev-init` when the harness venv is unpro…
fix(app): warn when setup.sh ios targets a physical device with OMI_D…