lib/xcode/install/simulators.rb in xcode-install-1.2.1 vs lib/xcode/install/simulators.rb in xcode-install-1.2.2
- old
+ new
@@ -5,11 +5,11 @@
class Simulators < Command
self.command = 'simulators'
self.summary = 'List or install iOS simulators.'
def self.options
- [['--install=version', 'Install simulator with the given version.']].concat(super)
+ [['--install=name', 'Install simulator beginning with name, e.g. \'iOS 8.4\', \'tvOS 9.0\'.']].concat(super)
end
def initialize(argv)
@installed_xcodes = Installer.new.installed_versions
@install = argv.option('install')
@@ -22,11 +22,11 @@
end
:private
def install
- filtered_simulators = @installed_xcodes.map(&:available_simulators).flatten.select do |sim|
- sim.version.to_s.start_with?(@install)
+ filtered_simulators = @installed_xcodes.map(&:available_simulators).flatten.uniq(&:name).select do |sim|
+ sim.name.start_with?(@install)
end
case filtered_simulators.count
when 0
puts "[!] No simulator matching #{@install} was found. Please specify a version from the following available simulators:".ansi.red
list