droid_adbs 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de9ff6761785392fee2f3046625447d66726ae35
4
- data.tar.gz: 27ef3ca245cbeb9fa4877f87a369576b3edb6640
3
+ metadata.gz: 73f3c16aceea96450551acd873b27abef9843199
4
+ data.tar.gz: 21dd0cd202221d9614108553561caf51dfc1d52c
5
5
  SHA512:
6
- metadata.gz: ff1d9f0edf9bfc1fb9de16ba6874309158da776536d48e949b50fc5d2adc22b306a8f748c9845607a79a74003ece0aebacefa4aaf92b529883e6ece854fbb49b
7
- data.tar.gz: f356565df2957019e52a6c9f577d35fa693f4cd4a97ccda96b8845a4b8209b5b3692b43402a55436153c5e7d4e4eb87d3b35877756d18f98f7deb6e6ca9e0a16
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 devices # means `adb devices`
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
@@ -0,0 +1,11 @@
1
+ module DroidAdbs
2
+ module Dumpsys
3
+ class << self
4
+ # @return [String] about dbinfo via adb command
5
+ def get_dbinfo(package = nil)
6
+ p = package ? package : ""
7
+ `#{::DroidAdbs.shell} dumpsys dbinfo #{p}`.strip
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module DroidAdbs
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-02-04 00:00:00.000000000 Z
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.6
102
+ rubygems_version: 2.6.8
102
103
  signing_key:
103
104
  specification_version: 4
104
105
  summary: adb command wrapper