stf-client 0.2.2 → 0.2.3
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/lib/stf/client.rb +2 -2
- data/lib/stf/interactor/start_one_debug_session_interactor.rb +3 -11
- data/lib/stf/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 940a21803596854335984f3c4351c7037b558887
|
4
|
+
data.tar.gz: 63e8d09703f81e772b7fe6c04bf56ae95597e609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 321db48a5bc789856c95ce38e8a58787365cddc2ce96ea6f0ccee4ba757ff611cbc8067280ed115e8babc117b7684d74dc488db9a20c3dea7e5722cec1cab6f0
|
7
|
+
data.tar.gz: 19321bf94f307379d854976e8973ef1104d603db49b19cca4d998b9279e162dfef40a12ba6bc6957ee1823d49209d25c1e2626777995c410447ead0ec0ac4b4d
|
data/lib/stf/client.rb
CHANGED
@@ -46,12 +46,12 @@ module Stf
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def start_debug(serial)
|
49
|
-
response = execute "/api/v1
|
49
|
+
response = execute "/api/v1/user/devices/#{serial}/remoteConnect", Net::HTTP::Post
|
50
50
|
return response
|
51
51
|
end
|
52
52
|
|
53
53
|
def stop_debug(serial)
|
54
|
-
response = execute "/api/v1
|
54
|
+
response = execute "/api/v1/user/devices/#{serial}/remoteConnect", Net::HTTP::Delete
|
55
55
|
return response.success
|
56
56
|
end
|
57
57
|
|
@@ -35,20 +35,12 @@ module Stf
|
|
35
35
|
|
36
36
|
execute_adb_with 30, "connect #{result.remoteConnectUrl}"
|
37
37
|
|
38
|
-
# Check for adb device status
|
39
|
-
execute_adb_with(30, 'devices')
|
40
|
-
device_list = last_stdout.split("\n")
|
41
|
-
device_list.shift
|
42
|
-
devices = Hash[device_list.collect {|device| [device.split("\t").first, device.split("\t").last]}]
|
43
|
-
|
44
|
-
if devices["#{result.remoteConnectUrl}"] != "device"
|
45
|
-
raise "adb connect #{result.remoteConnectUrl} succeeded but device is not in the adb devices list"
|
46
|
-
end
|
47
|
-
|
48
38
|
shell('exit', {serial: "#{result.remoteConnectUrl}"}, 30)
|
49
39
|
|
50
40
|
return true
|
51
41
|
|
42
|
+
rescue SignalException => e
|
43
|
+
raise e
|
52
44
|
rescue => e
|
53
45
|
begin
|
54
46
|
# we will try clean anyway
|
@@ -56,7 +48,7 @@ module Stf
|
|
56
48
|
rescue
|
57
49
|
end
|
58
50
|
|
59
|
-
logger.error "Failed to connect to #{serial}"
|
51
|
+
logger.error "Failed to connect to #{serial}: " + e.message
|
60
52
|
return false
|
61
53
|
end
|
62
54
|
end
|
data/lib/stf/version.rb
CHANGED