Class: AdbDevice::Device
- Inherits:
-
Object
- Object
- AdbDevice::Device
- Defined in:
- lib/adb_device/device.rb
Instance Method Summary collapse
- #brand ⇒ Object
-
#initialize(sn) ⇒ Device
constructor
A new instance of Device.
- #model ⇒ Object
- #os ⇒ Object
Constructor Details
#initialize(sn) ⇒ Device
Returns a new instance of Device.
4 5 6 |
# File 'lib/adb_device/device.rb', line 4 def initialize(sn) @sn = sn end |
Instance Method Details
#brand ⇒ Object
8 9 10 11 |
# File 'lib/adb_device/device.rb', line 8 def brand output = `adb -s #{@sn} shell getprop ro.product.brand` brand = output.tr("\n", "") end |
#model ⇒ Object
13 14 15 16 |
# File 'lib/adb_device/device.rb', line 13 def model output = `adb -s #{@sn} shell getprop ro.product.model` model = output.tr("\n", "") end |
#os ⇒ Object
18 19 20 21 |
# File 'lib/adb_device/device.rb', line 18 def os output = `adb -s #{@sn} shell getprop ro.build.version.release` os = output.match(Regexp.new(/([0-9]{1,2}|[0-9]{1,2}.[0-9]{1,2}|[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})\n/))[1] end |