Module: SimCtl::Command::Spawn

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

Instance Method Summary collapse

Instance Method Details

#spawn(device, path, args = [], _opts = {}) ⇒ String

Spawn a process on a device

Parameters:

  • device (SimCtl::Device)

    the device to spawn a process on

  • path (String)

    path to executable

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

    arguments for the executable

Returns:

  • (String)

    standard output the spawned process generated



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

def spawn(device, path, args = [], _opts = {})
  escaped_path = Shellwords.shellescape(path)
  command = command_for('spawn', device.udid, escaped_path, *args.map { |a| Shellwords.shellwords(a) })
  Executor.execute(command) do |output|
    output
  end
end