ash-adb 0.1.0 → 0.2.0
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 +17 -0
- data/lib/ash/adb/device.rb +32 -0
- data/lib/ash/adb/version.rb +1 -1
- 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: 1a52af17e597ab4951d220230dec7c4dbf3816f6
|
4
|
+
data.tar.gz: 89fa65f1f4b2f8a46955700c8e403dd9a5df1eae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6968767c4272d4551d17773de0794690a1f7f86da5ec5efbf83f243697f42cdf5083bb577dc45499780fef0f45cf96f5399c231116ea9d04fc4ec51af35162c9
|
7
|
+
data.tar.gz: 3aaadccb13fad01b2cebb13307b4789d891c8a3ba34381495481e96e30638aaeea425ffb883b0b3586731868ce3aa37f5b91a769a175467f8b3e6a59ff3a2bf4
|
data/README.md
CHANGED
@@ -40,10 +40,27 @@ devices.first.packages.first.package_name
|
|
40
40
|
devices.first.packages.first.package_path
|
41
41
|
# => "/system/app/Gallery2/Gallery2.apk"
|
42
42
|
|
43
|
+
# generate a list of device permission groups
|
44
|
+
devices.first.permission_groups
|
45
|
+
|
46
|
+
# list of libraries supported by the system
|
47
|
+
devices.first.libraries
|
48
|
+
|
49
|
+
# display the available device features
|
50
|
+
devices.first.features
|
51
|
+
|
43
52
|
# generate an adb bugreport
|
44
53
|
devices.first.generate_bugreport
|
45
54
|
# save a copy of an adb bugreport
|
46
55
|
devices.first.save_bugreport
|
56
|
+
|
57
|
+
# setup a tcp port forward (local, remote, remote_protocol)
|
58
|
+
# remote_protocol is optional (local, jwdp, tcp, device) and defaults to tcp with no argument
|
59
|
+
devices.first.adb_port_forward(3333, 44444)
|
60
|
+
devices.first.adb_port_forward(3333, 44444, jwdp)
|
61
|
+
|
62
|
+
# setup adb over wifi
|
63
|
+
devices.first.adb_over_wifi
|
47
64
|
```
|
48
65
|
|
49
66
|
## Development
|
data/lib/ash/adb/device.rb
CHANGED
@@ -17,6 +17,38 @@ module Ash::Adb
|
|
17
17
|
File.open(path, 'w') {|f| f.write(generate_bugreport) }
|
18
18
|
end
|
19
19
|
|
20
|
+
def adb_port_forward(local, remote, remote_protocol="tcp")
|
21
|
+
Ash::Adb::Client.run("adb -s #{@serial_number} forward tcp:#{local} #{remote_protocol}:#{remote}")
|
22
|
+
end
|
23
|
+
|
24
|
+
def adb_over_wifi
|
25
|
+
Ash::Adb::Client.run("adb -s #{@serial_number} tcpip 5555")
|
26
|
+
end
|
27
|
+
|
28
|
+
def permission_groups
|
29
|
+
adb_command = "adb -s #{@serial_number} shell pm list permission-groups"
|
30
|
+
raw_pg_output = Ash::Adb::Client.run(adb_command)
|
31
|
+
raw_pg_output.split("\r\n").map do |permission_group|
|
32
|
+
permission_group.split(":").last
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def features
|
37
|
+
adb_command = "adb -s #{@serial_number} shell pm list features"
|
38
|
+
raw_features_output = Ash::Adb::Client.run(adb_command)
|
39
|
+
raw_features_output.split("\r\n").map do |feature|
|
40
|
+
feature.split(":").last
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def libraries
|
45
|
+
adb_command = "adb -s #{@serial_number} shell pm list libraries"
|
46
|
+
raw_library_output = Ash::Adb::Client.run(adb_command)
|
47
|
+
raw_library_output.split("\r\n").map do |library|
|
48
|
+
library.split(":").last
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
20
52
|
def parse_device_package_list
|
21
53
|
Ash::Adb::Client.run("adb -s #{@serial_number} shell pm list packages -f").split("\r\n").map do |package_line|
|
22
54
|
package_line = package_line.split(":").last.split("=")
|
data/lib/ash/adb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ash-adb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomek Rabczak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|