From 1e40e11d93b2f9512894bb405c8d2a0d4a026bba Mon Sep 17 00:00:00 2001 From: Sam Mortimer Date: Sat, 10 Aug 2013 22:57:08 -0700 Subject: [PATCH] build: allow dopush to work properly with network adb Change-Id: I9efe60814d66dc8eb17544e6c2b94473dc903133 --- envsetup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/envsetup.sh b/envsetup.sh index b62371bb3..9a78af7c6 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -2122,8 +2122,17 @@ function dopush() if (adb shell cat /system/build.prop | grep -q "ro.cm.device=$CM_BUILD"); then + # retrieve IP and PORT info if we're using a TCP connection + TCPIPPORT=$(adb devices | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+[^0-9]+' \ + | head -1 | awk '{print $1}') adb root &> /dev/null sleep 0.3 + if [ -n "$TCPIPPORT" ] + then + # adb root just killed our connection + # so reconnect... + adb connect "$TCPIPPORT" + fi adb wait-for-device &> /dev/null sleep 0.3 adb remount &> /dev/null -- 2.11.0