* Parses the output of `xcrun simctl list devices` command
(text: string)
| 20 | * Parses the output of `xcrun simctl list devices` command |
| 21 | */ |
| 22 | function parseIOSDevicesList(text: string): Array<IOSDeviceInfo> { |
| 23 | const devices = []; |
| 24 | text.split('\n').forEach((line) => { |
| 25 | const device = line.match(/(.*?) \((.*?)\) \[(.*?)\]/); |
| 26 | const noSimulator = line.match(/(.*?) \((.*?)\) \[(.*?)\] \((.*?)\)/); |
| 27 | if (device != null && noSimulator == null){ |
| 28 | var name = device[1]; |
| 29 | var version = device[2]; |
| 30 | var udid = device[3]; |
| 31 | devices.push({udid, name, version}); |
| 32 | } |
| 33 | }); |
| 34 | |
| 35 | return devices; |
| 36 | } |
| 37 | |
| 38 | module.exports = parseIOSDevicesList; |
no test coverage detected
searching dependent graphs…