2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/simctl_parser.rb', line 2
def get_devices
output = `xcrun simctl list`.strip
output = output.split("== Devices ==").last
os = ""
output.lines.map do |line|
if line.strip.start_with?( "--")
os = line.gsub("-","").strip
end
if line.strip.length != 0 && line.strip.start_with?( "--") == false
{
:name => line.strip.split(" ")[0..-3].join(" "),
:state => line.strip.split(" ")[-1],
:id => line.strip.split(" ")[-2][1..-2].strip,
:os => os
}
end
end.compact
end
|