Skip to content

Commit

Permalink
fix: we need to tunnel 8081 for connected devices (#18862)
Browse files Browse the repository at this point in the history
`make run-android` would fail for connected Android devices because the android device was not able to talk to metro bundler.
This was discovered by @J-Son89
This was easily fixed by reverse tcping port 8081.

## Review notes
connect Android device by USB or Wifi
- `make run-clojure`
- `make run-android`
status app must run without any errors on the connected Android device.

we also replace during install on emulator.

otherwise on old emulators `make run-android` fails with :

```
adb: failed to install ./result/app-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install im.status.ethereum.debug without first uninstalling.]
```
  • Loading branch information
siddarthkay authored Feb 19, 2024
1 parent f394fcc commit c44ba69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ endif
export TMPDIR = /tmp/tmp-status-mobile-$(BUILD_TAG)
# This has to be specified for both the Node.JS server process and the Qt process.
export REACT_SERVER_PORT ?= 5001
# Default metro port used by scripts/run-android.sh.
export RCT_METRO_PORT ?= 8081
# Fix for ERR_OSSL_EVP_UNSUPPORTED error.
export NODE_OPTIONS += --openssl-legacy-provider
# The path can be anything, but home is usually safest.
Expand Down
4 changes: 3 additions & 1 deletion scripts/run-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ export BUILD_TYPE=debug

# Install the APK on running emulator or android device.
installAndLaunchApp() {
adb install ./result/app-debug.apk > "${ADB_INSTALL_LOG_FILE}" 2>&1
adb install -r ./result/app-debug.apk > "${ADB_INSTALL_LOG_FILE}" 2>&1
"${GIT_ROOT}/scripts/wait-for-metro-port.sh" 2>&1
# connected android devices need this port to be exposed for metro
adb reverse "tcp:${RCT_METRO_PORT}" "tcp:${RCT_METRO_PORT}"
adb shell monkey -p im.status.ethereum.debug 1 > "${ADB_SHELL_MONKEY_LOG_FILE}" 2>&1
}

Expand Down

0 comments on commit c44ba69

Please sign in to comment.