droid_adbs 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/droid_adbs.rb +1 -0
- data/lib/droid_adbs/commons/record.rb +44 -0
- data/lib/droid_adbs/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4b9995b5360dcd0f0b365f2470ff0581ff20b3
|
4
|
+
data.tar.gz: a44dedfe861f11e05e82dff1f46e9ff07fe6d6aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4ab7fbe52d27ab9bfb84a7c36f31a6a15fc5bc8159d50c06dc43d947ac9cff1bed1d72f525e1e9024e06a8a6ec44e6c86fc26734ff04a2f70c7ef762e719542
|
7
|
+
data.tar.gz: 5cb39d96f41b48b5a284994e0c5a8d6ccbb610aebd5a3201cd439d4d8d9043b4fb7c5c291b587eaa227107686a3236961aab3fd2df16d8fc85bad94dcd788e2a
|
data/lib/droid_adbs.rb
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
module DroidAdbs
|
2
|
+
module ScreenRecord
|
3
|
+
class Recording
|
4
|
+
attr_accessor :bit_rate, :size
|
5
|
+
|
6
|
+
private
|
7
|
+
|
8
|
+
attr_accessor :file_name, :recording
|
9
|
+
|
10
|
+
public
|
11
|
+
|
12
|
+
def initialize(device_serial: nil, bit_rate: 3000000, size: "1280x720")
|
13
|
+
@bit_rate = bit_rate
|
14
|
+
@size = size
|
15
|
+
|
16
|
+
::DroidAdbs.device_serial = device_serial if device_serial
|
17
|
+
@recording = false
|
18
|
+
end
|
19
|
+
|
20
|
+
def record(file_name:)
|
21
|
+
raise "Recording on the other process" if @recording
|
22
|
+
|
23
|
+
@file_name = file_name
|
24
|
+
|
25
|
+
@recording = true
|
26
|
+
@process_id = fork do
|
27
|
+
exec "#{::DroidAdbs.shell} screenrecord --bit-rate #{@bit_rate} --size #{@size} /sdcard/#{@file_name}.mp4"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def kill
|
32
|
+
Process.kill(:SIGINT, @process_id)
|
33
|
+
@recording = false
|
34
|
+
|
35
|
+
# Download the video
|
36
|
+
system "#{::DroidAdbs.adb_serial} pull /sdcard/#{@file_name}.mp4 #{Dir.pwd}"
|
37
|
+
sleep 5 # To finish pull command
|
38
|
+
|
39
|
+
# Delete the video from the device
|
40
|
+
system "#{::DroidAdbs.shell} rm /sdcard/#{@file_name}.mp4"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end # module Android
|
data/lib/droid_adbs/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.0
|
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-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/droid_adbs/commons/grant.rb
|
78
78
|
- lib/droid_adbs/commons/ime.rb
|
79
79
|
- lib/droid_adbs/commons/logcat.rb
|
80
|
+
- lib/droid_adbs/commons/record.rb
|
80
81
|
- lib/droid_adbs/commons/settings.rb
|
81
82
|
- lib/droid_adbs/commons/wm.rb
|
82
83
|
- lib/droid_adbs/version.rb
|