DO NOT MERGE: GetDevices: Also allow `\-` to be part of the host name
authorNicolas Boichat <drinkcat@google.com>
Thu, 5 Apr 2018 08:25:25 +0000 (16:25 +0800)
committerNicolas Boichat <drinkcat@google.com>
Wed, 9 May 2018 00:41:48 +0000 (00:41 +0000)
Change-Id: Ib4eaa0f1ded74d8733f378675fe509cf5a6b1c2b

android/scripts/common.py

index a158367..470666a 100644 (file)
@@ -173,7 +173,7 @@ def getDevices (adb):
        if proc.returncode != 0:
                raise Exception("adb devices -l failed, got %d" % proc.returncode)
 
-       ptrn = re.compile(r'^([a-zA-Z0-9\.:]+)\s+.*product:([^\s]+)\s+model:([^\s]+)\s+device:([^\s]+)')
+       ptrn = re.compile(r'^([a-zA-Z0-9\.\-:]+)\s+.*product:([^\s]+)\s+model:([^\s]+)\s+device:([^\s]+)')
        devices = []
        for line in stdout.splitlines()[1:]:
                if len(line.strip()) == 0: