From 1ac0810895c9adb881109fab1447d10d2689242d Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 11 Apr 2023 16:02:14 -0700 Subject: [PATCH] XcodeHelper: search for default iPhone simulator device id with a regular expression instead of a specific string Previously, the value was "iphone-11". Now the regex is ~/iphone-\d+/g As long as the naming scheme stays the same, this should choose the newest iPhone supported by Xcode, and we won't need to update manually anymore, like in commit 72dd60f1c851afac9f9166b963bc76e2ece15097 --- src/lime/tools/XCodeHelper.hx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lime/tools/XCodeHelper.hx b/src/lime/tools/XCodeHelper.hx index 11c0b236c..1565d516a 100644 --- a/src/lime/tools/XCodeHelper.hx +++ b/src/lime/tools/XCodeHelper.hx @@ -6,7 +6,7 @@ import lime.tools.HXProject; class XCodeHelper { private static inline var DEFAULT_IPAD_SIMULATOR = "ipad-air"; - private static inline var DEFAULT_IPHONE_SIMULATOR = "iphone-11"; + private static var DEFAULT_IPHONE_SIMULATOR_REGEX = ~/iphone-\d+/g; private static function extractSimulatorFlagName(line:String):String { @@ -92,7 +92,14 @@ class XCodeHelper } else { - currentDevice = devices.get(DEFAULT_IPHONE_SIMULATOR); + for (device in devices.keys()) + { + if (DEFAULT_IPHONE_SIMULATOR_REGEX.match(device)) + { + currentDevice = devices.get(device); + break; + } + } } }