Skip to content

fix(android): stop rewriting localhost to 10.0.2.2#1380

Open
MikitasK wants to merge 1 commit intocallstack:mainfrom
MikitasK:fix/hmr-on-android-physical-device
Open

fix(android): stop rewriting localhost to 10.0.2.2#1380
MikitasK wants to merge 1 commit intocallstack:mainfrom
MikitasK:fix/hmr-on-android-physical-device

Conversation

@MikitasK
Copy link
Copy Markdown

@MikitasK MikitasK commented Apr 16, 2026

Summary

Issue #1247

Fix Android physical-device dev server resolution by removing the unconditional runtime rewrite from localhost to 10.0.2.2

Previously, re.pack treated every Android runtime like an emulator. That caused:

  • HMR websocket URLs to resolve to ws://10.0.2.2:8081/__hmr
  • async chunk URLs to resolve to http://10.0.2.2:8081/...

It works on emulators, but breaks on physical devices, where 10.0.2.2 is unreachable

This change makes re.pack use the configured dev-server host literally, which allows Android physical devices to work correctly with the standard localhost + adb reverse flow

Test Plan

  1. connect an Android physical device with USB debugging enabled
  2. start the dev server from apps/tester-app with the default host by pnpm react-native webpack-start
  3. run adb reverse tcp:8081 tcp:8081
  4. launch "Tester App" on the Android physical device
  5. confirm the app loads successfully
  6. edit visible UI file such as apps/tester-app/src/App.tsx & save
  7. confirm HMR works - the UI should updates without full app relaunch

Recordiing

Screen.Recording.2026-04-16.at.19.01.41.mp4

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: eae27d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

@MikitasK is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@MikitasK MikitasK changed the title fix: stop rewriting android localhost to 10.0.2.2 fix(android): stop rewriting localhost to 10.0.2.2 Apr 16, 2026
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.

1 participant