diff --git a/lib/xcode.js b/lib/xcode.js index 28cb109..7e84916 100644 --- a/lib/xcode.js +++ b/lib/xcode.js @@ -433,9 +433,10 @@ exports.detect = function detect(options, callback) { // Map the platform and version from CoreSimulator string like: // - com.apple.CoreSimulator.SimRuntime.iOS-17-0 // - com.apple.CoreSimulator.SimRuntime.watchOS-10-0 + // - com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4 (iPhone Duo runtime -> 27.2) for (const key of Object.keys(devices)) { const [_, platform, rawVersion] = key.match(/\.SimRuntime\.(.*?)\-(.*)$/); - const version = rawVersion.replace(/-/g, '.'); + const version = (rawVersion.match(/^\d+(?:-\d+)*/) || [ rawVersion ])[0].replace(/-/g, '.'); const mapping = { name: `${platform} ${version}`, @@ -475,7 +476,8 @@ exports.detect = function detect(options, callback) { return next(err); } - var rtRegExp = /(iOS|watchOS)-(.+)$/; + // Device-specific runtimes such as iOS-27-2-iPhone19-4 (iPhone Duo) map to their numeric version, 27.2 + var rtRegExp = /(iOS|watchOS)-(\d+(?:-\d+)*)/; Object.keys(info.devices).forEach(function (rt) { var m = rt.match(rtRegExp); if (m) {