adb_device 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +14 -1
- data/lib/adb_device/device.rb +5 -0
- data/lib/adb_device/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30603b00c42fd99469418aeaef7d706a7e8d43968520a8c03bb6362666f472bd
|
4
|
+
data.tar.gz: 2b0969f794d64c5cf6de4774e129cf14b18c4af08921852dd3873478ec10352f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a8ed6a38f9cf56365293ebf15c1de95f4abd2cfacdce76e8f52209c9ee4c444ac19d4f1431d415312e1aa8b104d2131eb725c635a61532e554d45530e9708bf
|
7
|
+
data.tar.gz: 87ffaaa9562dba1031b1ffcb7660c1db48e13dbe2f0dae26f3e13826fcfd2d49278a529917032061a3402cdedaa62a805061ac7ef2554e5dd13abdfc35d0bf10
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,2 +1,15 @@
|
|
1
|
-
#
|
1
|
+
# AdbDevice
|
2
2
|
This is a gem for interacting with a connected Android devices
|
3
|
+
|
4
|
+
# Usage
|
5
|
+
```ruby
|
6
|
+
AdbDevice.device_list # returns Searial Numbers of connected devices ["a21dasd21","1231asd12]
|
7
|
+
# Make a Deivce object
|
8
|
+
device = AdbDevice::Device("a21dasd21")
|
9
|
+
# returns the brand of the device
|
10
|
+
device.brand # Xiaomi; samsung
|
11
|
+
# returns the model of the device
|
12
|
+
device.model # MI 9; SM-A310F
|
13
|
+
# returns device OS version
|
14
|
+
device.os # 10; 8.0.0
|
15
|
+
```
|
data/lib/adb_device/device.rb
CHANGED
@@ -14,5 +14,10 @@ module AdbDevice
|
|
14
14
|
output = `adb -s #{@sn} shell getprop ro.product.model`
|
15
15
|
model = output.tr("\n", "")
|
16
16
|
end
|
17
|
+
|
18
|
+
def os
|
19
|
+
output = `adb -s #{@sn} shell getprop ro.build.version.release`
|
20
|
+
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]
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
data/lib/adb_device/version.rb
CHANGED