From fc68cb6948819236bfcd88a21011016a5eb46f55 Mon Sep 17 00:00:00 2001 From: Nikita Romanov Date: Fri, 19 May 2023 10:25:38 +0400 Subject: [PATCH] Fix incorrect regex for catching physical devices --- src/DotNet.Meteor.Shared/Apple/SystemProfiler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DotNet.Meteor.Shared/Apple/SystemProfiler.cs b/src/DotNet.Meteor.Shared/Apple/SystemProfiler.cs index 5e3dbdb5..cc7a84ca 100644 --- a/src/DotNet.Meteor.Shared/Apple/SystemProfiler.cs +++ b/src/DotNet.Meteor.Shared/Apple/SystemProfiler.cs @@ -9,7 +9,7 @@ public static class SystemProfiler { public static List PhysicalDevices() { var profiler = PathUtils.SystemProfilerTool(); var devices = new List(); - var regex = new Regex(@"(iPhone:)[^,]*?Version:\s+(?\d+.\d+)[^,]*?Serial\sNumber:\s+(?\S+)"); + var regex = new Regex(@"(?iPhone|iPad):[^,]*?Version:\s+(?\d+.\d+)[^,]*?Serial\sNumber:\s+(?\S+)"); ProcessResult result = new ProcessRunner(profiler, new ProcessArgumentBuilder() .Append("SPUSBDataType")) @@ -22,6 +22,7 @@ public static List PhysicalDevices() { foreach (Match match in regex.Matches(output)) { var version = match.Groups["ver"].Value; + var device = match.Groups["dev"].Value; var serial = match.Groups["id"].Value; //For modern iOS devices, the serial number is 24 characters long if (serial.Length == 24) @@ -32,7 +33,7 @@ public static List PhysicalDevices() { IsRunning = true, IsMobile = true, RuntimeId = Runtimes.iOSArm64, - Name = $"iPhone {version}", + Name = $"{device} {version}", Detail = Details.iOSDevice, Platform = Platforms.iOS, Serial = serial