Module: SimCtl::Command::Create
- Included in:
- SimCtl::Command
- Defined in:
- lib/simctl/command/create.rb
Constant Summary collapse
- COMMAND =
%w[xcrun simctl create]
Instance Method Summary collapse
-
#create_device(name, devicetype, runtime) ⇒ SimCtl::Device
Creates a device.
Instance Method Details
#create_device(name, devicetype, runtime) ⇒ SimCtl::Device
Creates a device
14 15 16 17 18 19 20 21 22 |
# File 'lib/simctl/command/create.rb', line 14 def create_device(name, devicetype, runtime) runtime = runtime(name: runtime) unless runtime.is_a?(Runtime) devicetype = devicetype(name: devicetype) unless devicetype.is_a?(DeviceType) raise "Invalid runtime: #{runtime}" unless runtime.is_a?(Runtime) raise "Invalid devicetype: #{devicetype}" unless devicetype.is_a?(DeviceType) Executor.execute([COMMAND, Shellwords.shellescape(name), devicetype.identifier, runtime.identifier]) do |identifier| device(udid: identifier) end end |