module SimCtl::Command::Kill

Public Instance Methods

kill_device(device) click to toggle source

Kills a Simulator instance with the given device

@param device [SimCtl::Device] the device to kill @return [void]

# 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