Преглед изворни кода

android: always run adb reverse when starting the packager

It tends to close, so always open the reverse tunnel.
master
Saúl Ibarra Corretgé пре 5 година
родитељ
комит
31e996ac3f
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2
    1
      android/scripts/run-packager.sh

+ 2
- 1
android/scripts/run-packager.sh Прегледај датотеку

@@ -8,13 +8,14 @@ THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOUR
8 8
 export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}"
9 9
 echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${THIS_DIR}/../../node_modules/react-native/scripts/.packager.env"
10 10
 
11
+adb reverse tcp:8081 tcp:8081
12
+
11 13
 if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then
12 14
   if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then
13 15
     echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly"
14 16
     exit 2
15 17
   fi
16 18
 else
17
-    adb reverse tcp:8081 tcp:8081
18 19
     CMD="${THIS_DIR}/../../node_modules/react-native/scripts/launchPackager.command"
19 20
     if [[ `uname` == "Darwin"  ]]; then
20 21
         open -g "${CMD}" || echo "Can't start packager automatically"

Loading…
Откажи
Сачувај