[tools] test.py support Android devices with `.` in name

Closes: https://github.com/dart-lang/sdk/issues/51243
Change-Id: Ia165c6ecdc4d4ed6ad2799ae75a8ea68b0110757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280641
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
diff --git a/pkg/test_runner/lib/src/android.dart b/pkg/test_runner/lib/src/android.dart
index f7ca3bd..a4840cd 100644
--- a/pkg/test_runner/lib/src/android.dart
+++ b/pkg/test_runner/lib/src/android.dart
@@ -341,7 +341,7 @@
 /// Helper to list all adb devices available.
 class AdbHelper {
   static final RegExp _deviceLineRegexp =
-      RegExp(r'^([a-zA-Z0-9:_-]+)[ \t]+device$', multiLine: true);
+      RegExp(r'^(([a-zA-Z0-9:_-]|\.)+)[ \t]+device$', multiLine: true);
 
   static Future<List<String>> listDevices() {
     return Process.run('adb', ['devices']).then((ProcessResult result) {