Skip to content

fix(app): warn when setup.sh ios targets a physical device with OMI_DEV_HOST unset - #12091

Merged
kodjima33 merged 1 commit into
mainfrom
issues-improver/11534-warn-physical-device-loopback
Aug 24, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
issues-improver/11534-warn-physical-device-loopback

Conversation

@kodjima33

@kodjima33 kodjima33 commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator

What

setup.sh ios builds a dev flavor app pointing at http://127.0.0.1:8000/ by
default. On a physical iOS device, 127.0.0.1 resolves to the device itself,
not the Mac running the harness — so the app hangs waiting for a backend it
can never reach, with no indication why.

Two other setup blockers reported in #11534 (the npx firebase-tools install
prompt blocking headless, and the macOS Java stub passing the preflight check)
were already fixed on main. The harness also already supports a bind-host
override (OMI_DEV_HOST / OMI_DEV_BIND_HOST, documented in
docs/doc/developer/AppSetup.mdx). What was still missing is the third
remedy the reporter suggested: detect a physical-device target and warn
before the build starts, since the env var is easy to miss.

This adds that warning: run_build_ios in app/setup.sh now checks, for
dev builds, whether the selected device is physical (flutter devices --machine's own emulator field) and OMI_DEV_HOST is unset, and prints a
warning pointing at the fix instead of silently building a build that will
hang.

Testing

Extended app/test/shell/ios_device_selection_test.sh (the existing
behavioral-test harness for this file's device-selection logic) with cases
for the new _ios_device_is_physical helper — asserts true for a physical
device id and false for a simulator id, using the same flutter devices --machine stub the file already uses.

$ bash app/test/shell/ios_device_selection_test.sh
select_ios_device:
  ok   - returns the single iOS device's id, ignoring the non-iOS macOS entry
  ok   - fails with a named error instead of silently picking macOS (the regression)
  ok   - fails fast (rc=1) instead of blocking on read without a TTY
  ok   - fails with a named error when no devices are connected at all
_ios_device_is_physical:
  ok   - reports true for a physical device id
  ok   - reports false for a simulator id

all iOS device selection shell tests passed

Also verified bash -n app/setup.sh and shellcheck app/setup.sh produce no
new warnings.

Product invariants affected

none

Failure class (fixes)

Failure-Class: none

fixes #11534

Auto-generated from issue feedback by the mini issues-improver — tested and merged.

Review in cubic

…EV_HOST unset

Local dev backend binds to 127.0.0.1 by default. On a physical iOS device,
127.0.0.1 is the device itself, not the Mac — so a dev build silently hangs
waiting for a backend it can never reach, with no indication why. The bind-host
option (OMI_DEV_HOST/OMI_DEV_BIND_HOST) and two other setup blockers reported
in the same issue were already fixed; this lands the last suggested remedy:
detect a physical-device target and warn before the build starts.

fixes #11534
@kodjima33
kodjima33 merged commit da3591b into main Aug 24, 2026
30 checks passed
@kodjima33
kodjima33 deleted the issues-improver/11534-warn-physical-device-loopback branch August 24, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant