Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,19 @@ public IPhoneDeviceType DeviceType {
return null;

// Which product family are we looking for?
string productFamily;
string [] productFamilies;
switch (DeviceType) {
case IPhoneDeviceType.IPhone:
productFamily = "iPhone";
productFamilies = [ "iPhone" ];
break;
case IPhoneDeviceType.IPad:
productFamilies = [ "iPad" ];
break;
case IPhoneDeviceType.IPhoneAndIPad:
productFamily = "iPad";
productFamilies = [ "iPhone", "iPad" ];
break;
case IPhoneDeviceType.TV:
productFamily = "Apple TV";
productFamilies = [ "Apple TV" ];
break;
default:
throw new InvalidOperationException ($"Invalid device type: {DeviceType}");
Expand All @@ -85,7 +87,7 @@ public IPhoneDeviceType DeviceType {
var xml = new XmlDocument ();
xml.LoadXml (output);
// Get the device types for the product family we're looking for
var nodes = xml.SelectNodes ($"/MTouch/Simulator/SupportedDeviceTypes/SimDeviceType[ProductFamilyId='{productFamily}']")?.Cast<XmlNode> () ?? Array.Empty<XmlNode> ();
var nodes = xml.SelectNodes ($"/MTouch/Simulator/SupportedDeviceTypes/SimDeviceType[{string.Join (" or ", productFamilies.Select (v => $"ProductFamilyId='{v}'"))}]")?.Cast<XmlNode> () ?? Array.Empty<XmlNode> ();
// Create a list of them all
var deviceTypes = new List<(long Min, long Max, string Identifier)> ();
foreach (var node in nodes) {
Expand Down
Loading