Skip to content
Merged
Changes from all 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
6 changes: 4 additions & 2 deletions lib/xcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down Expand Up @@ -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) {
Expand Down
Loading