diff --git a/build/envsetup.sh b/build/envsetup.sh index a5b8b970..72bdfd40 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -789,7 +789,8 @@ function dopush() if (adb shell getprop ro.cm.device | grep -q "$CM_BUILD") || [ "$FORCE_PUSH" = "true" ]; 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]+' \ + TCPIPPORT=$(adb devices \ + | egrep '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]):[0-9]+[^0-9]+' \ | head -1 | awk '{print $1}') adb root &> /dev/null sleep 0.3