droid_adbs 0.1.6 → 0.1.7
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 +2 -0
- data/lib/droid_adbs/commons/backup.rb +0 -2
- data/lib/droid_adbs/commons/devices.rb +0 -2
- data/lib/droid_adbs/commons/grant.rb +0 -2
- data/lib/droid_adbs/commons/ime.rb +0 -2
- data/lib/droid_adbs/commons/settings.rb +0 -2
- data/lib/droid_adbs/commons/wm.rb +1 -3
- data/lib/droid_adbs/version.rb +1 -1
- data/lib/droid_adbs.rb +14 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac7f6e3a9711e3e9ec664e93509a280403f82d9c
|
4
|
+
data.tar.gz: 699b44b24c108e2e2d6adbf14d07c97ce9149895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca83e3c8988a3774cfe799525e5e996c7ac4b080faef2dc7b063a2505c3027805a1fcff040f9fc6f8cf19fb87400a4e48486079c68d5e6c7766a625d49e450f8
|
7
|
+
data.tar.gz: 35caa18e2a057e5a1aeff0197cd8e8a1643ffe7cd124d35ccebdbfbb8dbe02d34e744bd095e0a0705c1f488bf2bc7bf08379445fbc235c8a28c8313d1e169baa
|
data/README.md
CHANGED
@@ -22,6 +22,8 @@ Or install it yourself as:
|
|
22
22
|
Example:
|
23
23
|
|
24
24
|
```
|
25
|
+
require 'droid_adbs'
|
26
|
+
|
25
27
|
::DroidAdbs.device_serial = "device cerial you would like to connect" # set device_serial
|
26
28
|
::DroidAdbs devices # means `adb devices`
|
27
29
|
::DroidAdbs.install(app_path) # install `app_path` to the device
|
@@ -1,12 +1,10 @@
|
|
1
|
-
require_relative "../../droid_adbs"
|
2
|
-
|
3
1
|
module DroidAdbs
|
4
2
|
module WM
|
5
3
|
class << self
|
6
4
|
# @return [Integer] density. If this method fail to get density, then return 0.
|
7
5
|
def get_density
|
8
6
|
result = `#{::DroidAdbs.shell} wm density`.chomp
|
9
|
-
return 0 unless result.match
|
7
|
+
return 0 unless result.match(/\APhysical density:.*/)
|
10
8
|
result.split(/\s/).last.to_i
|
11
9
|
end
|
12
10
|
|
data/lib/droid_adbs/version.rb
CHANGED
data/lib/droid_adbs.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
require "droid_adbs/version"
|
2
|
+
require "droid_adbs/commons/settings"
|
3
|
+
require "droid_adbs/commons/devices"
|
4
|
+
require "droid_adbs/commons/backup"
|
5
|
+
require "droid_adbs/commons/ime"
|
6
|
+
require "droid_adbs/commons/wm"
|
7
|
+
require "droid_adbs/commons/grant"
|
8
|
+
require "droid_adbs/aapt"
|
9
9
|
|
10
10
|
module DroidAdbs
|
11
11
|
class << self
|
@@ -21,6 +21,11 @@ module DroidAdbs
|
|
21
21
|
"#{adb_serial} shell"
|
22
22
|
end
|
23
23
|
|
24
|
+
# @return [String] adb push command
|
25
|
+
def push
|
26
|
+
"#{adb_serial} push"
|
27
|
+
end
|
28
|
+
|
24
29
|
# @return [String] Get results of adb devices command
|
25
30
|
def devices
|
26
31
|
`#{adb} devices`
|
@@ -44,7 +49,7 @@ module DroidAdbs
|
|
44
49
|
# @param [String] app Application path
|
45
50
|
# @return [String] message from adb command
|
46
51
|
def install_with_grant(app)
|
47
|
-
result = `#{adb_serial} install -
|
52
|
+
result = `#{adb_serial} install -gr #{app}`
|
48
53
|
raise RuntimeError, result if result.include?("Error:")
|
49
54
|
raise RuntimeError, "invalid APK" if result.include?("Invalid APK file:")
|
50
55
|
raise RuntimeError, "failed to update apk because INSTALL_FAILED_VERSION_DOWNGRADE" if result.include?("INSTALL_FAILED_VERSION_DOWNGRADE")
|
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.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|