Sha256: dbe08d76775bf9eee7ba468999399306e8b84377f4dc26e91627959d3173bf32

Contents?: true

Size: 453 Bytes

Versions: 30

Compression:

Stored size: 453 Bytes

Contents

module SimCtl
  class Command
    module Kill
      # Kills a Simulator instance with the given device
      #
      # @param device [SimCtl::Device] the device to kill
      # @return [void]
      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
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
simctl-1.4.0 lib/simctl/command/kill.rb
simctl-1.3.1 lib/simctl/command/kill.rb
simctl-1.3.0 lib/simctl/command/kill.rb
simctl-1.2.3 lib/simctl/command/kill.rb
simctl-1.2.2 lib/simctl/command/kill.rb
simctl-1.2.1 lib/simctl/command/kill.rb
simctl-1.2.0 lib/simctl/command/kill.rb
simctl-1.1.0 lib/simctl/command/kill.rb
simctl-1.0.2 lib/simctl/command/kill.rb
simctl-1.0.1 lib/simctl/command/kill.rb