MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / parseIOSDevicesList

Function parseIOSDevicesList

local-cli/runIOS/parseIOSDevicesList.js:22–36  ·  view source on GitHub ↗

* Parses the output of `xcrun simctl list devices` command

(text: string)

Source from the content-addressed store, hash-verified

20 * Parses the output of `xcrun simctl list devices` command
21 */
22function 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
38module.exports = parseIOSDevicesList;

Callers 2

runIOSFunction · 0.85

Calls 2

matchMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…