Fix uuid for android emulators

This commit is contained in:
Lukasz Fryc 2018-04-26 08:22:11 +02:00
parent 1e66eaa742
commit 132ceda907
No known key found for this signature in database
GPG Key ID: 310D34060EB3FA78
1 changed files with 2 additions and 2 deletions

View File

@ -41,10 +41,10 @@ class AbstractTestCase:
updated_capabilities = list() updated_capabilities = list()
raw_out = re.split(r'[\r\\n]+', str(subprocess.check_output(['adb', 'devices'])).rstrip()) raw_out = re.split(r'[\r\\n]+', str(subprocess.check_output(['adb', 'devices'])).rstrip())
for line in raw_out[1:]: for line in raw_out[1:]:
serial = re.findall(r"([\d.\d:]*\d+)", line) serial = re.findall(r"(([\d.\d:]*\d+)|\bemulator-\d+)", line)
if serial: if serial:
capabilities = self.capabilities_local capabilities = self.capabilities_local
capabilities['udid'] = serial[0] capabilities['udid'] = serial[0][0]
updated_capabilities.append(capabilities) updated_capabilities.append(capabilities)
return updated_capabilities return updated_capabilities