fastlane-plugin-stream_actions 0.3.13 → 0.3.14

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
  SHA256:
3
- metadata.gz: ce7c546c1ee78741a67c5568904a919f73ee347b96a0ff34498c17474927f9aa
4
- data.tar.gz: 2024f8e83bb74818e49da6f1c686277061e2fcc8a0dd3b18155754cd9524e48c
3
+ metadata.gz: e590801a23665170ef777a8f2edc02fdd1a906e389c746cf2d38e38a83fdd549
4
+ data.tar.gz: 423cd6c7cdd6d1332abf73db5742958a0e8ed96b567ac876ec82e0a5817c44e0
5
5
  SHA512:
6
- metadata.gz: 763e516beae5317fcabdcc7c8eb239e66876db3bfbc8471c0eb5d6c115ea17e7c65346175d12715febe416e35544cbd6707c718ce51e22a0812e254e9380bb24
7
- data.tar.gz: 46a94c972bcad08d990d2da3f2798065632e8ea6345e8e348f9dd5932c3d1adae4ed28d79d1e80571c8979b5a933aab72c73be7c0611153c6a541aeeb4a8f0f0
6
+ metadata.gz: 7cadaaea43caa84ffade2b7588e853ab97972c61f0ed33f2ee21707ef34585f008db02b09c0954e5928f7a2bc2b9a8c3af9a31df84e77a60aebada42aef78f5c
7
+ data.tar.gz: f35416b73c287ae215a8f3f3e34738aa5ddcb299abc1a776b1a8c92a1a78c8119a49ca7860cc992749880330d159f19b64dbfe0c09f8cdd615e6b8d19ba0f92c
@@ -3,37 +3,25 @@ module Fastlane
3
3
  class WaitAndroidEmuIdleAction < Action
4
4
  def self.run(params)
5
5
  start_time = Time.now
6
- load_threshold = 1.0
7
6
  UI.important("Start waiting until device is idle (#{Time.now})")
8
- adb_command = 'adb shell uptime | cut -d , -f 3 | cut -f 2 -d :'
9
- load = `#{adb_command}`.strip.to_f
10
-
11
- end_time = start_time + 1800
12
- while load > load_threshold && Time.now < end_time
13
- if load < 4
14
- `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" || echo`
15
- anr_package = `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" | cut -f 2 -d : | sed -e "s/}//" -e "s/^ *//"`.strip
16
- unless anr_package.empty?
17
- UI.important("ANR on screen for: #{anr_package}. Restarting it.")
18
- begin
19
- `adb shell su 0 killall #{anr_package}`
20
- rescue StandardError => e
21
- UI.error(e)
22
- # Fallback to click if kill didn't work. This location is for a 1080x1920 screen
23
- `adb shell input tap 540 935 || echo`
24
- end
25
-
26
- if anr_package == 'com.android.systemui'
27
- `adb shell am start-service -n com.android.systemui/.SystemUIService || echo`
28
- end
29
- end
7
+ check_emu_uptime = 'adb shell uptime | cut -d , -f 3 | cut -f 2 -d :'
8
+ current_load_value = `#{check_emu_uptime}`.strip.to_f
9
+
10
+ end_time = start_time + params[:timeout]
11
+ while current_load_value > params[:load_threshold] && Time.now < end_time
12
+ not_responding_package = `adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" | cut -f 2 -d : | sed -e "s/}//" -e "s/^ *//"`.strip
13
+ if not_responding_package == 'com.android.systemui'
14
+ UI.important("Trying to dismiss not responding #{not_responding_package} dialog")
15
+ `adb shell input keyevent KEYCODE_ENTER`
16
+ `adb shell input keyevent KEYCODE_DPAD_DOWN`
17
+ `adb shell input keyevent KEYCODE_ENTER`
30
18
  end
31
19
 
32
20
  sleep(10)
33
- load = `#{adb_command}`.strip.to_f
21
+ current_load_value = `#{check_emu_uptime}`.strip.to_f
34
22
  end
35
23
 
36
- UI.important('Reached timeout before device is idle 😕') if load > load_threshold
24
+ UI.important('Reached timeout before device is idle 😕') if current_load_value > params[:load_threshold]
37
25
  UI.important("Waited until device is idle for #{(Time.now - start_time).to_i} seconds ⌛️")
38
26
  end
39
27
 
@@ -46,7 +34,20 @@ module Fastlane
46
34
  end
47
35
 
48
36
  def self.available_options
49
- []
37
+ [
38
+ FastlaneCore::ConfigItem.new(
39
+ key: :load_threshold,
40
+ description: 'Load threshold to consider device idle',
41
+ is_string: false,
42
+ default_value: 1.0
43
+ ),
44
+ FastlaneCore::ConfigItem.new(
45
+ key: :timeout,
46
+ description: 'Timeout in seconds to wait for device to be idle',
47
+ is_string: false,
48
+ default_value: 1000
49
+ )
50
+ ]
50
51
  end
51
52
 
52
53
  def self.supported?(_platform)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.13'
3
+ VERSION = '0.3.14'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list