Class: RunLoop::CLI::Instruments
- Inherits:
-
Thor
- Object
- Thor
- RunLoop::CLI::Instruments
- Defined in:
- lib/run_loop/cli/instruments.rb
Instance Attribute Summary collapse
-
#signal ⇒ Object
Returns the value of attribute signal.
Instance Method Summary collapse
Instance Attribute Details
#signal ⇒ Object
Returns the value of attribute signal.
9 10 11 |
# File 'lib/run_loop/cli/instruments.rb', line 9 def signal @signal end |
Instance Method Details
#launch ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/run_loop/cli/instruments.rb', line 101 def launch if RunLoop::Xcode.new.version_gte_8? puts "Launching applications with Xcode 8 is not supported" exit 1 end debug = [:debug] original_value = ENV['DEBUG'] ENV['DEBUG'] = '1' if debug begin = { :args => parse_app_launch_args(), :udid => (), :app => detect_bundle_id_or_bundle_path() } run_loop = RunLoop.run() puts JSON.generate(run_loop) ensure ENV['DEBUG'] = original_value if debug end end |
#quit ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/run_loop/cli/instruments.rb', line 28 def quit if RunLoop::Xcode.new.version_gte_8? puts "instruments quit with Xcode 8 is not supported" exit 1 end signal = [:signal] ENV['DEBUG'] = '1' if [:debug] instruments = RunLoop::Instruments.new instruments.instruments_pids.each do |pid| terminator = RunLoop::ProcessTerminator.new(pid, signal, 'instruments') unless terminator.kill_process terminator = RunLoop::ProcessTerminator.new(pid, 'KILL', 'instruments') terminator.kill_process end end end |