Module: SimCtl::Command::Kill
- Included in:
- SimCtl::Command
- Defined in:
- lib/simctl/command/kill.rb
Instance Method Summary collapse
-
#kill_device(device) ⇒ void
Kills a Simulator instance with the given device.
Instance Method Details
#kill_device(device) ⇒ void
This method returns an undefined value.
Kills a Simulator instance with the given device
8 9 10 11 12 13 14 15 |
# File 'lib/simctl/command/kill.rb', line 8 def kill_device(device) pid = `ps xww | grep Simulator.app | grep -s #{device.udid} | grep -v grep | awk '{print $1}'`.chomp if pid.to_i > 0 system 'kill', pid else false end end |