adb_device 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/adb_device.rb +10 -13
- data/lib/adb_device/device.rb +18 -0
- data/lib/adb_device/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86e8137b39282bd2d4a427ee47e17c0958f181dfacabcd819e24f209fd547754
|
4
|
+
data.tar.gz: b1d0018e0acca42fa045991eab4752a64b04a98656fde5b1e327737b261f8685
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dd15ada3316966b9c78eb5c730d03f4161b14eebdeeae5cdeffe871dad10515f357a17e7833a246eb65f4259f16278206e755f734f741271b89d34e3f58c6c6
|
7
|
+
data.tar.gz: fae47032c4714abedbc5970b88d4395f351d95b16f59abe9a93defada5fb96494afb87ea760b70911802794d14b7f5ee6d4e9364cbaf772cf44698943ddaf036
|
data/Gemfile.lock
CHANGED
data/lib/adb_device.rb
CHANGED
@@ -1,21 +1,18 @@
|
|
1
1
|
require "adb_device/version"
|
2
|
+
require "adb_device/device"
|
2
3
|
|
3
4
|
module AdbDevice
|
4
5
|
class Error < StandardError; end
|
5
|
-
|
6
|
-
class Device
|
7
|
-
def initialize(sn)
|
8
|
-
@sn = sn
|
9
|
-
end
|
10
6
|
|
11
|
-
def
|
12
|
-
output = `adb
|
13
|
-
|
7
|
+
def AdbDevice.device_list
|
8
|
+
output = `adb devices`
|
9
|
+
udids = []
|
10
|
+
if output.match?(/\n([0-9a-zA-Z].+)\t/)
|
11
|
+
udids = output.scan(/\n([0-9a-zA-Z].+)\t/).flatten
|
12
|
+
else
|
13
|
+
return "No devices connected"
|
14
|
+
end
|
15
|
+
udids
|
14
16
|
end
|
15
17
|
|
16
|
-
def model
|
17
|
-
output = `adb -s #{@sn} shell getprop ro.product.model`
|
18
|
-
model = output.tr("\n", "")
|
19
|
-
end
|
20
|
-
end
|
21
18
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
module AdbDevice
|
3
|
+
class Device
|
4
|
+
def initialize(sn)
|
5
|
+
@sn = sn
|
6
|
+
end
|
7
|
+
|
8
|
+
def brand
|
9
|
+
output = `adb -s #{@sn} shell getprop ro.product.brand`
|
10
|
+
brand = output.tr("\n", "")
|
11
|
+
end
|
12
|
+
|
13
|
+
def model
|
14
|
+
output = `adb -s #{@sn} shell getprop ro.product.model`
|
15
|
+
model = output.tr("\n", "")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/adb_device/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adb_device
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristaps Indriksons
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- bin/console
|
57
57
|
- bin/setup
|
58
58
|
- lib/adb_device.rb
|
59
|
+
- lib/adb_device/device.rb
|
59
60
|
- lib/adb_device/version.rb
|
60
61
|
homepage: https://rubygems.org/gems/adb_device
|
61
62
|
licenses: []
|