summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorSam Mortimer <sam@mortimer.me.uk>2013-08-10 22:57:08 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-10-06 16:26:34 -0700
commit9e0a3f767bd9135ddb20b025b8af40ae8baceda1 (patch)
tree238ffc225cc82e7f75a1d471d8ceda1d0098bf23 /envsetup.sh
parentd2fbc25a6761fa15e72bc25c114c4e5f91adeb24 (diff)
downloadbuild-9e0a3f767bd9135ddb20b025b8af40ae8baceda1.zip
build-9e0a3f767bd9135ddb20b025b8af40ae8baceda1.tar.gz
build-9e0a3f767bd9135ddb20b025b8af40ae8baceda1.tar.bz2
build: allow dopush to work properly with network adb
Change-Id: I9efe60814d66dc8eb17544e6c2b94473dc903133
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh
index cfd2c69..f7810b7 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -2030,8 +2030,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