GetDevices: Also allow `\-` to be part of the host name
authorNicolas Boichat <drinkcat@google.com>
Wed, 9 May 2018 00:44:11 +0000 (08:44 +0800)
committerNicolas Boichat <drinkcat@google.com>
Thu, 10 May 2018 00:04:07 +0000 (00:04 +0000)
Bug: b/79494592

Change-Id: I2e79a8389be53300296f07bcbae902a717da2d5e

scripts/android/install_apk.py

index a3558ee..67fc621 100644 (file)
@@ -55,7 +55,7 @@ def getDevices (adbPath):
        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: