diff --git a/Makefile b/Makefile index 11a8d1de95..c1fc6ca074 100644 --- a/Makefile +++ b/Makefile @@ -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. diff --git a/scripts/run-android.sh b/scripts/run-android.sh index 97c3b0c81d..a013b174a6 100755 --- a/scripts/run-android.sh +++ b/scripts/run-android.sh @@ -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 }