| 
1 | 1 | module SimLauncher  | 
2 |  | -  class DirectClient  | 
3 |  | -    def initialize( app_path, sdk, family )  | 
4 |  | -      @app_path = File.expand_path( app_path )  | 
5 |  | -      @sdk = sdk  | 
6 |  | -      @family = family  | 
7 |  | -    end  | 
8 |  | - | 
9 |  | -    def self.for_ipad_app( app_path, sdk = nil )  | 
10 |  | -      self.new( app_path, sdk, 'ipad' )  | 
11 |  | -    end  | 
12 |  | - | 
13 |  | -    def self.for_iphone_app( app_path, sdk = nil )  | 
14 |  | -      self.new( app_path, sdk, 'iphone' )  | 
15 |  | -    end  | 
16 |  | - | 
17 |  | -    def launch  | 
18 |  | -      SimLauncher::Simulator.new.launch_ios_app( @app_path, @sdk, @family )   | 
19 |  | -    end  | 
20 |  | - | 
21 |  | -    def rotate_left  | 
22 |  | -      simulator = SimLauncher::Simulator.new  | 
23 |  | -      simulator.rotate_left  | 
24 |  | -    end  | 
25 |  | -      | 
26 |  | -    def rotate_right  | 
27 |  | -      simulator = SimLauncher::Simulator.new  | 
28 |  | -      simulator.rotate_right  | 
29 |  | -    end  | 
30 |  | - | 
31 |  | - | 
32 |  | - | 
33 |  | -    def relaunch  | 
34 |  | -      simulator = SimLauncher::Simulator.new  | 
35 |  | -      simulator.quit_simulator  | 
36 |  | -      simulator.launch_ios_app( @app_path, @sdk, @family )  | 
37 |  | -    end  | 
38 |  | -  end  | 
 | 2 | +	class DirectClient  | 
 | 3 | +		def initialize( app_path, sdk, options ={} )  | 
 | 4 | +			@app_path = File.expand_path( app_path )  | 
 | 5 | +			@sdk = sdk  | 
 | 6 | +			@family = options[:family]  | 
 | 7 | +			@device_type_identifier = options[:device_type_identifier]  | 
 | 8 | +		end  | 
 | 9 | + | 
 | 10 | +		def self.for_ipad_app( app_path, sdk = nil )  | 
 | 11 | +			self.new( app_path, sdk, 'ipad' )  | 
 | 12 | +		end  | 
 | 13 | + | 
 | 14 | +		def self.for_iphone_app( app_path, sdk = nil )  | 
 | 15 | +			self.new( app_path, sdk, 'iphone' )  | 
 | 16 | +		end  | 
 | 17 | + | 
 | 18 | +		def launch  | 
 | 19 | +			if @device_type_identifier.to_s != ''  | 
 | 20 | +				SimLauncher::Simulator.new.launch_ios_app_with_device_identifier(@app_path, @sdk, @device_type_identifier)  | 
 | 21 | +			else  | 
 | 22 | +				SimLauncher::Simulator.new.launch_ios_app( @app_path, @sdk, @family, @device_type_identifier)  | 
 | 23 | +			end  | 
 | 24 | + | 
 | 25 | +		end  | 
 | 26 | + | 
 | 27 | +		def rotate_left  | 
 | 28 | +			simulator = SimLauncher::Simulator.new  | 
 | 29 | +			simulator.rotate_left  | 
 | 30 | +		end  | 
 | 31 | + | 
 | 32 | +		def rotate_right  | 
 | 33 | +			simulator = SimLauncher::Simulator.new  | 
 | 34 | +			simulator.rotate_right  | 
 | 35 | +		end  | 
 | 36 | + | 
 | 37 | + | 
 | 38 | + | 
 | 39 | +		def relaunch  | 
 | 40 | +			simulator = SimLauncher::Simulator.new  | 
 | 41 | +			simulator.quit_simulator  | 
 | 42 | +			launch  | 
 | 43 | +		end  | 
 | 44 | +	end  | 
39 | 45 | end  | 
0 commit comments