Module: DeviceAPI::IOS

Defined in:
lib/device_api/ios/device.rb,
lib/device_api/ios.rb,
lib/device_api/ios/idevice.rb,
lib/device_api/ios/ipaddress.rb,
lib/device_api/ios/idevicename.rb,
lib/device_api/ios/idevicedebug.rb,
lib/device_api/ios/ideviceinstaller.rb,
lib/device_api/ios/ideviceprovision.rb

Overview

iOS component of DeviceAPI

Defined Under Namespace

Classes: Device, IDevice, IDeviceCommandError, IDeviceDebug, IDeviceDebugError, IDeviceInstaller, IDeviceInstallerError, IDeviceName, IDeviceNameError, IDeviceProvision, IDeviceProvisionError, IPAddress, IPAddressError

Class Method Summary collapse

Class Method Details

.device(serial) ⇒ Object

Retrieve a Device object by serial ID



23
24
25
26
27
28
# File 'lib/device_api/ios.rb', line 23

def self.device(serial)
  if serial.to_s.empty?
    raise DeviceAPI::BadSerialString.new("Serial was '#{ serial.nil? ? 'nil' : serial }'")
  end
  DeviceAPI::IOS::Device.new(serial: serial, state: 'device')
end

.devicesObject

Returns an array of connected iOS devices



14
15
16
17
18
19
20
# File 'lib/device_api/ios.rb', line 14

def self.devices
  IDevice.devices.map do |d|
    if d.keys.first
      DeviceAPI::IOS::Device.new(serial: d.keys.first, display: d.values.flatten.first, state: 'ok')
    end
  end
end