Module: SimCtl::Command::Terminate

Included in:
SimCtl::Command
Defined in:
lib/simctl/command/terminate.rb

Instance Method Summary collapse

Instance Method Details

#terminate_app(device, identifier, args = []) ⇒ void

This method returns an undefined value.

Terminates an app on the given device

Parameters:

  • device (SimCtl::Device)

    the device with the app to terminate

  • identifier (String)

    the app identifier

  • args (Array) (defaults to: [])

    optional terminate arguments



12
13
14
15
16
17
18
# File 'lib/simctl/command/terminate.rb', line 12

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