droid_adbs 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/lib/droid_adbs/commons/dumpsys.rb +11 -0
- data/lib/droid_adbs/version.rb +1 -1
- data/lib/droid_adbs.rb +17 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73f3c16aceea96450551acd873b27abef9843199
|
4
|
+
data.tar.gz: 21dd0cd202221d9614108553561caf51dfc1d52c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a28fbeec586d2bc2316ef2fdc7c20288f2721d0df420ff4afbb28e89b975b122bce6648a35fc86e0a83c7595eb0af34f138a76e2856ec3070d260867eea65ed
|
7
|
+
data.tar.gz: 8b87a5d25f86168688c822ae39c47664cfddb6e7891fd3e64cee27c93136350fbfc77056ab0bbd58735dce0c96d302f67f046747d1b4eb07d67181da6219063e
|
data/README.md
CHANGED
@@ -24,11 +24,20 @@ Example:
|
|
24
24
|
```
|
25
25
|
require 'droid_adbs'
|
26
26
|
|
27
|
-
::DroidAdbs.device_serial = "device cerial you would like to connect" # set device_serial
|
28
|
-
::DroidAdbs
|
27
|
+
::DroidAdbs.device_serial = "device cerial you would like to connect" # set device_serial as a class variable
|
28
|
+
::DroidAdbs.devices # means `adb devices`
|
29
29
|
::DroidAdbs.install(app_path) # install `app_path` to the device
|
30
30
|
```
|
31
31
|
|
32
|
+
Send command over tcp:
|
33
|
+
|
34
|
+
```
|
35
|
+
::DroidAdbs.device_serial = "device cerial you would like to connect" # set device_serial as a class variable
|
36
|
+
::DroidAdbs.set_tcpip = 5555 # set ip to a device
|
37
|
+
::DroidAdbs.connect("198.168.255.1", 5555) # connect to the device. `device_serial` is updated with host:port.
|
38
|
+
::DroidAdbs.install(app_path) # install `app_path` to the device over tcp
|
39
|
+
```
|
40
|
+
|
32
41
|
Please read yard documents if you would like to know more.
|
33
42
|
|
34
43
|
## Development
|
data/lib/droid_adbs/version.rb
CHANGED
data/lib/droid_adbs.rb
CHANGED
@@ -6,12 +6,29 @@ require "droid_adbs/commons/ime"
|
|
6
6
|
require "droid_adbs/commons/wm"
|
7
7
|
require "droid_adbs/commons/grant"
|
8
8
|
require "droid_adbs/commons/logcat"
|
9
|
+
require "droid_adbs/commons/dumpsys"
|
9
10
|
require "droid_adbs/aapt"
|
10
11
|
|
11
12
|
module DroidAdbs
|
12
13
|
class << self
|
13
14
|
attr_accessor :device_serial
|
14
15
|
|
16
|
+
# @param [String|Integer] ip Port number set to android device.
|
17
|
+
# @return [String] adb command with serial
|
18
|
+
def set_tcpip(ip)
|
19
|
+
`#{adb_serial} tcpip #{ip}`.strip
|
20
|
+
end
|
21
|
+
|
22
|
+
# @param [String] host Host name to android device. e.g. 198.168.255.1
|
23
|
+
# @param [String|Integer] port Port number set to android device with set_tcpip. e.g. 5555(default)
|
24
|
+
# @return [String] adb command with serial
|
25
|
+
def connect(host = 'localhost', port = 5555)
|
26
|
+
connect_to = %(#{host}:#{port})
|
27
|
+
|
28
|
+
self.device_serial = connect_to
|
29
|
+
`#{adb_serial} connect #{connect_to}`.strip
|
30
|
+
end
|
31
|
+
|
15
32
|
# @return [String] adb command with serial
|
16
33
|
def adb_serial
|
17
34
|
"#{adb} #{device_serial_option}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: droid_adbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/droid_adbs/aapt.rb
|
73
73
|
- lib/droid_adbs/commons/backup.rb
|
74
74
|
- lib/droid_adbs/commons/devices.rb
|
75
|
+
- lib/droid_adbs/commons/dumpsys.rb
|
75
76
|
- lib/droid_adbs/commons/grant.rb
|
76
77
|
- lib/droid_adbs/commons/ime.rb
|
77
78
|
- lib/droid_adbs/commons/logcat.rb
|
@@ -98,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
99
|
version: '0'
|
99
100
|
requirements: []
|
100
101
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.6.
|
102
|
+
rubygems_version: 2.6.8
|
102
103
|
signing_key:
|
103
104
|
specification_version: 4
|
104
105
|
summary: adb command wrapper
|