fastlane-plugin-automated_test_emulator_run 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -8
- data/lib/fastlane/plugin/automated_test_emulator_run/actions/automated_test_emulator_run_action.rb +4 -16
- data/lib/fastlane/plugin/automated_test_emulator_run/factory/avd_controller_factory.rb +2 -2
- data/lib/fastlane/plugin/automated_test_emulator_run/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: 27443e3467529ba90c77da7b237ca4cbd0f76b7e
|
4
|
+
data.tar.gz: 75e3d1fd84428b7f3959d4101b533baba22aac56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb1300326fce2ab21604ad41843734503fd7af046093149cb6a42d3c5427b2fc41a84789b77504e5d2f5acb7c2a371b1ddcdcc6ec342b075c60248437a293bd
|
7
|
+
data.tar.gz: 9dc424a43ea210c9893d6bbdf133e11d8971b64c63d5cf2e5640f39ac3a5910b58b172376d9e73c8660aca0f82e1796d51c2d968111abe6266899031ae48bf02
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-automated_test_emulator_run)
|
4
4
|
|
5
|
-
|
5
|
+
<b>(article is deprecated - covered plugin version < 1.3.2 which doesn't support Build-Tools ver. >= 25.0.2)</b>
|
6
|
+
<br>See [blog post related to this plugin](https://medium.com/azimolabs/managing-android-virtual-devices-during-test-session-98a403acffc2#.upcmonil1). You can learn there how to create basic setup for this plugin step by step.
|
6
7
|
|
7
8
|
## About automated_test_emulator_run
|
8
9
|
|
@@ -37,16 +38,18 @@ JSON file scheme:
|
|
37
38
|
"avd_list":
|
38
39
|
[
|
39
40
|
{
|
40
|
-
"avd_name": "",
|
41
|
+
"avd_name": "",
|
41
42
|
|
42
|
-
"
|
43
|
+
"create_avd_package": "",
|
44
|
+
"create_avd_device": "",
|
45
|
+
"create_avd_tag": "",
|
43
46
|
"create_avd_abi": "",
|
47
|
+
"create_avd_additional_options": "",
|
44
48
|
"create_avd_hardware_config_filepath": "",
|
45
|
-
"create_avd_additional_options": "",
|
46
49
|
|
50
|
+
"launch_avd_port": "",
|
47
51
|
"launch_avd_snapshot_filepath": "",
|
48
52
|
"launch_avd_launch_binary_name": "",
|
49
|
-
"launch_avd_port": "",
|
50
53
|
"launch_avd_additional_options": ""
|
51
54
|
}
|
52
55
|
]
|
@@ -54,9 +57,12 @@ JSON file scheme:
|
|
54
57
|
```
|
55
58
|
|
56
59
|
Parameters:
|
60
|
+
<br>For official help refer to `avdmanager` binary file: `<sdk_root>/tools/bin/avdmanager create avd`
|
57
61
|
- `avd_name` - name of your AVD, avoid using spaces, this field is necessary
|
58
|
-
- `
|
59
|
-
- `
|
62
|
+
- `create_avd_package` - path to system image in example "system-images;android-23;google_apis;x86_64"
|
63
|
+
- `create_avd_device` - optional label for device e.g. "For plugin tests only. Do not touch."
|
64
|
+
- `create_avd_tag` - the sys-img tag to use for the AVD. e.g. if you are using Google Apis then set it to "google_apis"
|
65
|
+
- `create_avd_abi` - abi for AVD e.g. "x86" or "x86_64" (https://developer.android.com/ndk/guides/abis.html)
|
60
66
|
- `create_avd_hardware_config_filepath` - path to config.ini file containing custom config for your AVD. After AVD is created this file will be copied into AVD location before it launches.
|
61
67
|
- `create_avd_additional_options` - if you think that you need something more you can just add your create parameters here (e.g. "--sdcard 128M", https://developer.android.com/studio/tools/help/android.html)
|
62
68
|
- `launch_avd_snapshot_filepath` - plugin might (if you set it) delete and re-create AVD before test start. That means all your permissions and settings will be lost on each emulator run. If you want to apply qemu image with saved AVD state you can put path to it in this field. It will be applied by using "-wipe-data -initdata <path to your file>"
|
@@ -64,8 +70,11 @@ Parameters:
|
|
64
70
|
- `launch_avd_port` - port on which you wish your AVD should be launched, if you leave this field empty it will be assigned automatically
|
65
71
|
- `launch_avd_additional_options` - if you need more customization add your parameters here (e.g. "-gpu on -no-boot-anim -no-window", https://developer.android.com/studio/run/emulator-commandline.html)
|
66
72
|
|
67
|
-
|
73
|
+
Note:
|
74
|
+
- parameter `--path` is not supported, if you want to change directory to where your AVD are created edit your env variable ANDROID_SDK_HOME. Which is set to `~/.android/avd` by default.
|
68
75
|
|
76
|
+
Hints:
|
77
|
+
- <b> After change from `android` bin to `avdmanager` bin, default settings of AVD created from terminal has changed. No resolution is set. We highly recommend to use config.ini files which you can set to `create_avd_hardware_config_filepath` or specify resolution in `create_avd_additional_options`. </b>
|
69
78
|
- all fields need to be present in JSON, if you don't need any of the parameters just leave it empty
|
70
79
|
- pick even ports for your AVDs
|
71
80
|
- if you can't launch more than 2 AVDs be sure to check how much memory is your HAXM allowed to use (by default it is 2GB and that will allow you to launch around 2 AVDs) If you face any problems with freezing AVDs then be sure to reinstall your HAXM and allow it to use more of RAM (https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager)
|
data/lib/fastlane/plugin/automated_test_emulator_run/actions/automated_test_emulator_run_action.rb
CHANGED
@@ -93,7 +93,9 @@ module Fastlane
|
|
93
93
|
# Launching AVDs
|
94
94
|
UI.message("Launching all AVDs at the same time.".yellow)
|
95
95
|
for i in 0...avd_controllers.length
|
96
|
-
|
96
|
+
Process.fork do
|
97
|
+
Action.sh(avd_controllers[i].command_start_avd)
|
98
|
+
end
|
97
99
|
end
|
98
100
|
|
99
101
|
# Wait for AVDs finish booting
|
@@ -220,20 +222,6 @@ module Fastlane
|
|
220
222
|
all_devices_visible = false unless is_visible
|
221
223
|
end
|
222
224
|
|
223
|
-
# Check for unauthorized statuses and break further check if any found - WORKAROUND (temporary I hope...)
|
224
|
-
any_of_devices_unauthorized = devices.include?("unauthorized")
|
225
|
-
if any_of_devices_unauthorized
|
226
|
-
UI.message(["This seems to be bug of recent Build Tools 25.0.2. Device is launched but ADB status froze with value 'unauthorized'."].join("").red)
|
227
|
-
UI.message(["Unfortunately to workaround this, ADB server has to be restarted - in order to update device statuses. We hope it can be fixed soon. More info at:"].join("").red)
|
228
|
-
UI.message(["https://github.com/AzimoLabs/fastlane-plugin-automated-test-emulator-run/issues/8"].join("").yellow)
|
229
|
-
|
230
|
-
# Restart ADB
|
231
|
-
UI.message("Restarting adb".yellow)
|
232
|
-
Action.sh(adb_controller.command_stop)
|
233
|
-
Action.sh(adb_controller.command_start)
|
234
|
-
next
|
235
|
-
end
|
236
|
-
|
237
225
|
# Check if device is booted
|
238
226
|
all_devices_booted = true
|
239
227
|
launch_status_hash.each do |name, is_booted|
|
@@ -243,7 +231,7 @@ module Fastlane
|
|
243
231
|
all_devices_booted = false unless launch_status_hash[name]
|
244
232
|
end
|
245
233
|
|
246
|
-
# Quit if
|
234
|
+
# Quit if timeout reached
|
247
235
|
if ((currentTime - startTime) >= timeoutInSeconds)
|
248
236
|
UI.message(["AVD ADB loading took more than ", timeout, ". Attempting to re-launch."].join("").red)
|
249
237
|
launch_status = false
|
@@ -51,7 +51,7 @@ module Fastlane
|
|
51
51
|
sh_create_config_loc = "#{path_avd}/#{avd_scheme.avd_name}.avd/config.ini"
|
52
52
|
|
53
53
|
# Launch AVD shell command parts
|
54
|
-
|
54
|
+
sh_launch_emulator_binary = [path_sdk, "/emulator/", avd_scheme.launch_avd_launch_binary_name].join("")
|
55
55
|
sh_launch_avd_name = ["-avd ", avd_scheme.avd_name].join("")
|
56
56
|
sh_launch_avd_additional_options = avd_scheme.launch_avd_additional_options
|
57
57
|
sh_launch_avd_port = ["-port", avd_scheme.launch_avd_port].join(" ")
|
@@ -88,7 +88,7 @@ module Fastlane
|
|
88
88
|
avd_output = File.exists?(avd_controller.output_file) ? ["&>", avd_controller.output_file.path, "&"].join("") : "&>/dev/null &"
|
89
89
|
|
90
90
|
avd_controller.command_start_avd = [
|
91
|
-
|
91
|
+
sh_launch_emulator_binary,
|
92
92
|
sh_launch_avd_port,
|
93
93
|
sh_launch_avd_name,
|
94
94
|
sh_launch_avd_snapshot,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-automated_test_emulator_run
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kamil Krzyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|