Change Regex to correctly match against my device.

Since we don't care about the port, just allow any characters between the spaces after the device ID and the product.

Running Windows 10, running "adb devices -l" with my device attached to the computer gives:
FA34MW904146           device product:cm_m7 model:One device:m7

Which wasn't being matched correctly (no info on USB port).
This commit is contained in:
Nathan Kerr
2015-11-14 11:25:29 -08:00
parent ed297f476a
commit d36af446f2

View File

@@ -509,7 +509,7 @@ class AndroidDevice extends Device {
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
RegExp deviceRegex1 = new RegExp(
r'^(\S+)\s+device\s+\S+\s+product:(\S+)\s+model:(\S+)\s+device:(\S+)$');
r'^(\S+)\s+device\s+.*product:(\S+)\s+model:(\S+)\s+device:(\S+)$');
// 0149947A0D01500C device usb:340787200X
RegExp deviceRegex2 = new RegExp(r'^(\S+)\s+device\s+\S+$');