Class: Luffa::Simulator

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/luffa/ios/simulator.rb

Instance Method Summary collapse

Instance Method Details

#core_simulator_device_containers_dir(sim_udid) ⇒ Object



20
21
22
# File 'lib/luffa/ios/simulator.rb', line 20

def core_simulator_device_containers_dir(sim_udid)
  File.expand_path(File.join(core_simulator_device_dir(sim_udid), 'Containers'))
end

#core_simulator_device_dir(sim_udid = nil) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/luffa/ios/simulator.rb', line 12

def core_simulator_device_dir(sim_udid=nil)
  if sim_udid.nil?
    @core_simulator_device_dir ||= File.expand_path(File.join(core_simulator_home_dir, 'Devices'))
  else
    File.expand_path(File.join(core_simulator_device_dir, sim_udid))
  end
end

#core_simulator_for_xcode_version(idiom, form_factor, xcode_version) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/luffa/ios/simulator.rb', line 24

def core_simulator_for_xcode_version(idiom, form_factor, xcode_version)
  if xcode_version < Luffa::Version.new('6.1')
    ios_version = '8.0'
  elsif xcode_version < Luffa::Version.new('6.2')
    ios_version = '8.1'
  elsif xcode_version < Luffa::Version.new('6.3')
    ios_version = '8.2'
  elsif xcode_version >= Luffa::Version.new('6.3')
    ios_version = '8.3'
  else
    raise "Unsupported Xcode version: #{xcode_version}"
  end
  "#{idiom} #{form_factor} (#{ios_version} Simulator)"
end

#core_simulator_home_dirObject



8
9
10
# File 'lib/luffa/ios/simulator.rb', line 8

def core_simulator_home_dir
  @core_simulator_home_dir ||= File.expand_path('~/Library/Developer/CoreSimulator')
end