Skip to content

setup.sh ios builds an app that hangs on the splash screen when the local backend harness isn't running #11534

Closed

Description

@formed2forge

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

API_BASE_URL=http://127.0.0.1:8000/
USE_WEB_AUTH=true
USE_AUTH_CUSTOM_TOKEN=true

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.

Two things make this hard to self-diagnose:

  1. The prerequisite is invisible. setup.sh neither starts the harness nor checks for it, and never mentions it. (Docs for this are proposed separately in docs(app): point mobile setup at the local backend harness, not api.omiapi.com #11532.)
  2. 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.

Activity

  1. formed2forge commented on Aug 14, 2026

    @formed2forge
    ContributorAuthor

    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:

    $ lsof -nP -iTCP:8000 -sTCP:LISTEN
    Python  24540  tim  10u  IPv4  TCP 127.0.0.1:8000 (LISTEN)     ← loopback only
    
    $ curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8000/       → 200    (from the Mac)
    $ curl -s -o /dev/null -w '%{http_code}' http://192.168.1.247:8000/   → exit 7, refused
    

    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:

    1. 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.
    2. 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.

  2. moved this from Someday to In progress in omi TODO / bountieson Aug 23, 2026
  3. added a commit that references this issue on Aug 24, 2026
    da3591b
  4. moved this from In progress to In review in omi TODO / bountieson Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions