Sha256: 101b8d67366707290ad7ebadf084616449e7894fdd52923778c71a7b98510227

Contents?: true

Size: 704 Bytes

Versions: 7

Compression:

Stored size: 704 Bytes

Contents

require 'shellwords'

module SimCtl
  class Command
    module Terminate
      # Terminates an app on the given device
      #
      # @param device [SimCtl::Device] the device with the app to terminate
      # @param identifier [String] the app identifier
      # @param args [Array] optional terminate arguments
      # @return [void]
      def terminate_app(device, identifier, args = [])
        unless Xcode::Version.gte? '8.2'
          raise UnsupportedCommandError, 'Needs at least Xcode 8.2'
        end
        terminate_args = args.map { |arg| Shellwords.shellescape arg }
        Executor.execute(command_for('terminate', terminate_args, device.udid, identifier))
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simctl-1.6.10 lib/simctl/command/terminate.rb
simctl-1.6.8 lib/simctl/command/terminate.rb
simctl-1.6.7 lib/simctl/command/terminate.rb
simctl-1.6.6 lib/simctl/command/terminate.rb
simctl-1.6.5 lib/simctl/command/terminate.rb
simctl-1.6.4 lib/simctl/command/terminate.rb
simctl-1.6.3 lib/simctl/command/terminate.rb