Skip to content

fix: use host machine IP for real devices instead of adb reverse#94

Open
slava-markovski-unity wants to merge 1 commit into
AppiumTestDistribution:masterfrom
slava-markovski-unity:fix/real-device-stf-proxy-ip
Open

fix: use host machine IP for real devices instead of adb reverse#94
slava-markovski-unity wants to merge 1 commit into
AppiumTestDistribution:masterfrom
slava-markovski-unity:fix/real-device-stf-proxy-ip

Conversation

@slava-markovski-unity
Copy link
Copy Markdown

Problem

adb reverse silently fails through ADB relay setups (STF, Headspin, and any device farm that proxies ADB connections). The command exits 0 but the reverse tunnel is never actually established on the device side — from the device's perspective there is nothing listening on localhost:PORT, so every HTTPS CONNECT through the proxy fails with:

java.io.IOException: unexpected end of stream
  at okhttp3.internal.connection.RealConnection.createTunnel
  at okhttp3.internal.connection.RealConnection.connectTunnel

This makes the plugin completely non-functional on any device farm using an ADB relay.

Fix

Use the host machine's public IPv4 for all device types instead of localhost + adb reverse. Physical devices reach the proxy over Wi-Fi (they are on the same network as the Appium host in any standard device farm setup). Emulators can reach the host IP just as well as before.

The adb reverse call is removed since it is no longer needed.

Verified on

  • Local AVD (Android emulator) — works
  • STF with physical Pixel 6 running Android 16 — works

adb reverse silently fails through ADB relay setups (STF, Headspin,
and any device farm that proxies ADB connections). The reverse tunnel
command exits 0 but is never established on the device side, so
connections to localhost:PORT on the device get nothing and fail with
'unexpected end of stream'.

Using the host machine's public IPv4 directly works for both physical
devices (reachable over Wi-Fi on the same network as the Appium host)
and emulators, with no regression.

Verified on:
- Local AVD (Android emulator) — fix works
- STF with physical Pixel 6 running Android 16 — fix works
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