Giter Club home page Giter Club logo

fastlane-plugin-automated-test-emulator-run's Introduction

automated_test_emulator_run plugin

fastlane Plugin Badge

(article is deprecated - covered plugin version < 1.3.2 which doesn't support Build-Tools ver. >= 25.0.2)
See blog post related to this plugin. You can learn there how to create basic setup for this plugin step by step.

About automated_test_emulator_run

Starts any number of AVDs. AVDs are created and configured automatically according to user liking before instrumentation test process starts (started either via shell command or from gradle) and killed/deleted after test process finishes.

Getting Started

This project is a fastlane plugin.

  1. To get started with fastlane-plugin-automated_test_emulator_run, add it to your project by running:
fastlane add_plugin automated_test_emulator_run
  1. Create your *.JSON config file to create AVD launch plan according to schema below/provided example.

  2. Wrap your test launch command with plugin and provide link to *.JSON config.

Example of Fastfile

Check out the example Fastfile to see how to use this plugin. Try it by cloning the repo, running fastlane install_plugins and bundle exec fastlane test.

JSON config

What is JSON config?

It is a core of this plugin. User can specify any number of AVD devices in JSON file. Each AVD can be configured separately. Plugin will read JSON file and create fresh, new, untouched AVDs on host - use them in tests - and then delete them after test process finishes.

JSON file scheme:

{
    "avd_list":
    [
        {
          "avd_name": "",

          "create_avd_package": "",
          "create_avd_device": "",
          "create_avd_tag": "",
          "create_avd_abi": "",
          "create_avd_additional_options": "",
          "create_avd_hardware_config_filepath": "",

          "launch_avd_port": "",
          "launch_avd_snapshot_filepath": "",
          "launch_avd_launch_binary_name": "",
          "launch_avd_additional_options": ""
        }
    ]
}

Parameters:
For official help refer to avdmanager binary file: <sdk_root>/tools/bin/avdmanager create avd

  • avd_name - name of your AVD, avoid using spaces, this field is necessary
  • create_avd_package - path to system image in example "system-images;android-23;google_apis;x86_64"
  • create_avd_device - name of your device visible on avdmanager list device list
  • 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"
  • create_avd_abi - abi for AVD e.g. "x86" or "x86_64" (https://developer.android.com/ndk/guides/abis.html)
  • 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.
  • 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)
  • 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 "
  • launch_avd_launch_binary_name - depending on your CPU architecture you need to choose binary file which should launch your AVD (e.g. "emulator", "emulator64-arm")
  • launch_avd_port - port on which you wish your AVD should be launched, if you leave this field empty it will be assigned automatically
  • 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)

Note:

  • 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.

Hints:

  • 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.
  • all fields need to be present in JSON, if you don't need any of the parameters just leave it empty
  • pick even ports for your AVDs
  • 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)
  • make sure you have all targets/abis installed on your PC if you want to use them (type in terminal: android list targets)
  • we recommend adding -gpu on to your launching options for each device, it helps when working with many AVDs

Example:

Example of complete JSON file can be found here.

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting doc in the main fastlane repo.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out fastlane.tools.

Towards financial services available to all

We’re working throughout the company to create faster, cheaper, and more available financial services all over the world, and here are some of the techniques that we’re utilizing. There’s still a long way ahead of us, and if you’d like to be part of that journey, check out our careers page.

fastlane-plugin-automated-test-emulator-run's People

Contributors

fisherkk avatar frogermcs avatar ilsinszkibal avatar jetersen avatar mathroule avatar pbrdmn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fastlane-plugin-automated-test-emulator-run's Issues

Installing plugin fails

I'm trying to install the plugin with fastlane 2.19.1 on macOS 10.12.3 with XCode 8.2.1. The installation fails with the following error:

$ fastlane add_plugin automated_test_emulator_run
+---------------------------------------------+---------+-----------------------------+
|                                    Used plugins                                     |
+---------------------------------------------+---------+-----------------------------+
| Plugin                                      | Version | Action                      |
+---------------------------------------------+---------+-----------------------------+
| fastlane-plugin-instrumented_tests          | 0.1.5   | instrumented_tests          |
+---------------------------------------------+---------+-----------------------------+

[11:56:31]: Make sure to commit your Gemfile, Gemfile.lock and Pluginfile to version control
Installing plugin dependencies...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3/ext/json/ext/generator
/Users/xxx/.fastlane/bin/bundle/bin/ruby -r ./siteconf20170303-7636-cjaqez.rb extconf.rb 
creating Makefile

current directory: /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Users/xxx/.fastlane/bin/bundle/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/xxx/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/ruby.h:29:
/Users/xxx/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/defines.h:26:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3 for inspection.
Results logged to /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/json-2.0.3/gem_make.out

An error occurred while installing json (2.0.3), and Bundler cannot continue.
Make sure that `gem install json -v '2.0.3'` succeeds before bundling.

Getting stuck at "Performing wait for params: dev.bootcomplete, sys.boot_completed, init.svc.bootanim."

After updating the plugin to 1.4.1, the devices are getting created and launched, ADB boot gets completed with successfully but then it gets stuck at "Performing wait for params: dev.bootcomplete, sys.boot_completed, init.svc.bootanim."

This is how my avd config looks like
{
"avd_name": "Test-Emulator-API21_1",
"create_avd_package": "system-images;android-21;google_apis;x86_64",
"create_avd_device": "Nexus 5",
"create_avd_tag": "google_apis",
"create_avd_abi": "x86_64",
"create_avd_additional_options": "--skin "1080x1920" --sdcard 2048M",
"create_avd_hardware_config_filepath": "",
"launch_avd_snapshot_filepath": "",
"launch_avd_launch_binary_name": "emulator",
"launch_avd_port": "",
"launch_avd_additional_options": "-gpu on -no-boot-anim -partition-size 2048 -wipe-data -skin "1080x1920""
}

No permission when pulling screenshots

Hi there.
I am using Screengrab to capture screenshots during ui tests.
Screengrab runs the ui test itself and tries to pull them at the end from the device. That works fine when I run the uiTestsWithScreenshots lane separately but not when it is called from the automated_test_emulator_run plugin.
I need to be adb root to be able to pull the screenshots.
When I set use_adb_root: true the lane crashes

[10:17:25]: Clearing phoneScreenshots within fastlane/metadata/android
[10:17:25]: $ /Users/tristan/Library/Android/sdk/platform-tools/adb -s emulator-5556 shell echo \$EXTERNAL_STORAGE
[10:17:25]: ▸ /sdcard
[10:17:25]: $ /Users/tristan/Library/Android/sdk/platform-tools/adb root
restarting adbd as root
timeout expired while waiting for device
[10:17:31]: Exit status: 1
Traceback (most recent call last):
	30: from /usr/local/bin/fastlane:23:in `<main>'
	29: from /usr/local/bin/fastlane:23:in `load'
	28: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/bin/fastlane:23:in `<top (required)>'
	27: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	26: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	25: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
	24: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	23: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	22: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	21: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	20: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	19: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	18: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	17: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	16: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	15: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	14: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	13: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	12: from Fastfile:15:in `block (2 levels) in parsing_binding'
	11: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	10: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	 9: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
	 8: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
	 7: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:253:in `block in execute_action'
	 6: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	 5: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:261:in `block (2 levels) in execute_action'
	 4: from /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-automated_test_emulator_run-1.6.0/lib/fastlane/plugin/automated_test_emulator_run/actions/automated_test_emulator_run_action.rb:185:in `run'
	 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `sh'
	 2: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
	 1: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.142.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [!] Exit status of command 'fastlane uiTestsWithScreenshots' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)

when set to use_adb_root: false there is no crash but I get a permission denied error when pulling the screenshot folder.
Running the automated_test_emulator_run plugin as adb root might solve the problem. What do you think about it?

automated_test_emulator_run(
    AVD_setup_path: "fastlane/avd_api29_setup.json",
    AVD_recreate_new: false,
    AVD_clean_after: false,
    shell_task: "fastlane uiTestsWithScreenshots"
)
lane :uiTestsWithScreenshots do
    gradle(task: "assembleDebug assembleAndroidTest")
    screengrab(
        locales: ['en-US'],
        ending_locale: 'en-US',
        use_adb_root: true,
        clear_previous_screenshots: true,
        app_package_name: "com.littlepay.android.sdk.sample",
        app_apk_path: "sample/build/outputs/apk/debug/sample-debug.apk",
        tests_apk_path: "sample/build/outputs/apk/androidTest/debug/sample-debug-androidTest.apk"
    )
end

Launch multiple AVD

Hi and thanks for your great fastlane plugin!

Is it possible to launch multiple AVD using the same command, in order to run spoon tests on a phone and a tablet in parallel?

Running fastlane screengrab on multiple AVDs

Using #3 as a base for this issue, I would like to run fastlane's Screengrab on all my AVDs and this does not seem to be working at the moment.

My fastfile:

lane :assemble_apk_and_grab_screenshots do
  gradle(task: "assembleDebug assembleDebugAndroidTest")
  screengrab
 end

 lane :grab_screenshots do
  automated_test_emulator_run(
   AVD_setup_path: "~/project/fastlane/AVD_config.json",
   AVD_recreate_new: false,
   AVD_clean_after: false,
   shell_task: "fastlane assemble_apk_and_grab_screenshots"
  )
 end

What this does is launch my AVDs and runs my tests successfully. However, when I get to the screengrab task, only one emulator is showing there are screenshots available on the sdcard. The other emulator shows an error that there are no screenshots stored on the sdcard.

Both AVDs should have screenshots saved to them, since they are running the same tests. However, somehow, the screenshots from the first emulator are being cleaned when the second one completes.

running screengrab

Is it only possible to use gradle_task and shell_task when using this? Would be great for example to be able to run screengrab.

Incorrect PATH

Is there a way to set the path from /home/[user]/Android/Sdk/tools/bin/avdmanager (it does not exists) to
/home/[user]/Android/tools/bin ?

The automated_test_emulator_run plugin is working!
[09:58:32]: Preparing commands for Android ADB
[09:58:32]: Preparing parameters and commands for emulator: Nexus_6P_API_27
[09:58:32]: Configuring environment in order to launch emulators:
[09:58:32]: Getting avaliable AVDs
[09:58:32]: $ /home/janko/Android/Sdk/tools/bin/avdmanager list avd
[09:58:32]: ▸ Error: Could not find or load main class com.android.sdklib.tool.AvdManagerCli
+------------------+------------------+
| Lane Context |
+------------------+------------------+
| DEFAULT_PLATFORM | android |
| PLATFORM_NAME | android |
| LANE_NAME | android ui_tests |
+------------------+------------------+
[09:58:32]: Exit status of command '/home/janko/Android/Sdk/tools/bin/avdmanager list avd' was 1 instead of 0.
Error: Could not find or load main class com.android.sdklib.tool.AvdManagerCli

android command fails after sdk update

WI the latest Android SDK I get this error trying to use the plugin:

+------------------+--------------------------------+ [14:45:30]: Exit status of command '/Users/markus/Library/Android/sdk/tools/android list avd' was 1 instead of 0. The android command is no longer available. For manual SDK and AVD management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager

AVD is not starting

Hello,

For any reason my emulator is not starting.

My config.json:

{
  "avd_list": [
    {

      "avd_name": "Test-Emulator-API23-Nexus-5-1",

      "create_avd_package": "system-images;android-23;google_apis;x86_64",
      "create_avd_device": "Nexus 5X",
      "create_avd_tag": "google_apis",
      "create_avd_abi": "x86_64",
      "create_avd_additional_options": "",
      "create_avd_hardware_config_filepath": "~/.android/avd/Test-Emulator-API23-Nexus-5-1.ini",

      "launch_avd_port": "",
      "launch_avd_snapshot_filepath": "~/.android/avd/Test-Emulator-API23-Nexus-5-1.avd/cache.img",
      "launch_avd_launch_binary_name": "emulator",
      "launch_avd_additional_options": "-gpu on"

    }
  ]
}

I tried to start the emulator directly using the plugin command:

Any suggestion?

Add option to skip reset adb

Thanks for great plugin!

In our setup - we run tests for couple different projects on single build machine with Jenkins.

Issue is, plugin restarts adb, because of code here
https://github.com/AzimoLabs/fastlane-plugin-automated-test-emulator-run/blob/master/lib/fastlane/plugin/automated_test_emulator_run/actions/automated_test_emulator_run_action.rb#L74

Restarting adb, while other test run in progress, causes that test run to fail.

It would be really nice, to be able disable that adb restart via config option.

How to install apk?

This is not really an issue, but since the documentation doesn't state this clearly and I can't find another forum for this plugin I will ask here.

What is the recommended way of installing an apk for instrumentation tests using this plugin? Should you call another lane using the shell_task, and execute adb commands there to push, install etc?

I'm in a situation where I'm running CI on gitlab and the emulator doesn't recognize the local build folder where the apk is, and starts rebuilding it inside the container when running the instrumentation test via "gradle_task".

AVD_setup.json path must be an absolute url

When trying to use the setup json from the same directory ./avd-setup.json the plugin cannot find the file. This make is difficult to use the plugin CI or when the file is commited to a VCS.

Empty list of attached devices

I have a problem with plugin, list of attached devices are always empty but it seems that the device is created.

` [16:59:03]: �[33mRe-creating new AVD.�[0m

[16:59:03]: �[4m�[36m$ echo "no" | /usr/local/Caskroom/android-sdk/25.2.3/tools/bin/avdmanager create avd --name "TestAvdList" --package "system-images;android-23;google_apis;x86" --tag google_apis --abi x86 �[0m�[0m

[16:59:44]: ▸ �[35mDo you wish to create a custom hardware profile? [no]�[0m

[16:59:44]: �[33mRestarting adb�[0m

[16:59:44]: �[4m�[36m$ /usr/local/Caskroom/android-sdk/25.2.3/platform-tools/adb kill-server�[0m�[0m

[16:59:44]: ▸ �[35m* server not running *�[0m

[16:59:44]: �[4m�[36m$ /usr/local/Caskroom/android-sdk/25.2.3/platform-tools/adb start-server�[0m�[0m

[16:59:48]: ▸ �[35m* daemon not running. starting it now at tcp:5037 *�[0m

[16:59:48]: ▸ �[35m* daemon started successfully *�[0m

[16:59:48]: �[33mAttemting to apply custom config to TestAvdList�[0m

[16:59:48]: �[33mNo config file found for AVD 'TestAvdList'. AVD won't have config.ini applied.�[0m

[16:59:48]: �[33mLaunching all AVDs at the same time.�[0m

[16:59:48]: �[33mWaiting for AVDs to finish booting.�[0m

[16:59:48]: �[33mPerformig wait for ADB boot�[0m

[16:59:48]: �[4m�[36m$ /usr/local/Caskroom/android-sdk/25.2.3/emulator/emulator -port 5556 -avd TestAvdList &>/var/folders/n3/kxvcvj0d7d52dds2jtm_mxs4000086/T/emulator_output20170612-2178-18zme14&�[0m�[0m

[16:59:58]: �[4m�[36m$ /usr/local/Caskroom/android-sdk/25.2.3/platform-tools/adb devices�[0m�[0m

[16:59:58]: ▸ �[35mList of devices attached�[0m

[17:00:08]: �[4m�[36m$ /usr/local/Caskroom/android-sdk/25.2.3/platform-tools/adb devices�[0m�[0m

[17:00:08]: ▸ �[35mList of devices attached�[0m `

create_avd_device does not appear to work as described

When I try using create_avd_device as a label I get this error:

[!] Exit status of command 'echo "no" | ~/Library/Android/sdk/tools/bin/avdmanager create avd --name "Test-Phone" --package "system-images;android-25;google_apis;x86" --device "Ephemeral Test Phone" --tag google_apis --abi x86 ' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Error: No device found matching --device Ephemeral Test Phone.

Presumably the --device arg doesn't work the same in avdmanager as it did in the old android avd tool.

avd error

my avd config file:

{
"avd_list": [
{
"avd_name": "EM1",
"create_avd_package": "system-images;android-24;google_apis;x86",
"create_avd_device": "EM1",
"create_avd_tag": "google_apis",
"create_avd_abi": "x86",
"create_avd_additional_options": "AVD_recreate_new false",
"create_avd_hardware_config_filepath": "/.android/avd/EM1.avd/config.ini",
"launch_avd_port": "2557",
"launch_avd_snapshot_filepath": "
/.android/avd/EM1.avd/config.ini/EM1_SNAPSHOT.img",
"launch_avd_launch_binary_name": "emulator2",
"launch_avd_additional_options": "-gpu on"
}
]
}

I get error:


[17:36:44]: AVD with name 'EM1' does not exist. Creating new AVD.
[17:36:44]: $ echo "no" | /Users/sdutta/Library/Android/sdk/tools/bin/avdmanager create avd --name "EM1" --package "system-images;android-24;google_apis;x86" --device "EM1" --tag google_apis --abi x86 
[17:36:45]: ▸ Error: No device found matching --device EM1.
[17:36:45]: ▸ null
+------------------+--------------------+
|             Lane Context              |
+------------------+--------------------+
| DEFAULT_PLATFORM | android            |
| PLATFORM_NAME    | android            |
| LANE_NAME        | android fastscreen |
+------------------+--------------------+
[17:36:46]: Exit status of command 'echo "no" | /Users/sdutta/Library/Android/sdk/tools/bin/avdmanager create avd --name "EM1" --package "system-images;android-24;google_apis;x86" --device "EM1" --tag google_apis --abi x86 ' was 1 instead of 0.
Error: No device found matching --device EM1.
null

Emulator launch freezes on linux

Hi, we use your plugin for a while on MacOS build server with Jenkins and it works really great!
However, recently, we've decided to add linux based (Ubuntu 16.04) slave machine to distribute load from main build server.

Issue is first emulator launch (we use two emulators for our tests) command freezes whole build. It seems trailing & doesn't work and emulator process doesn't go background to subshell. Emulator itself boots normally

It shows only following:

[11:09:49]: $ /home/android-build-server/Android/Sdk/tools/emulator -port 5558 -avd UI-Test-API25-Nexus-5X  -gpu auto -skin 1080x1920 &>/tmp/emulator_output20170328-12236-1tcx549&
[11:09:49]: ▸ sh: 1: glxinfo: not found
[11:09:50]: ▸ sh: 1: glxinfo: not found
[11:09:55]: ▸ pulseaudio: pa_context_connect() failed
[11:09:55]: ▸ pulseaudio: Reason: Connection refused
[11:09:55]: ▸ pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

The same command, launched in regular terminal works like a charm (goes to background and returns 0 exit code).

Maybe, it would be more stable to use ruby processes/threads instead of subshell to avoid such issues?

Deprecated variant API in 2019

I am getting warnings that multiple API's from variant are getting deprecated in 2019 only when I run the fastlane that initiates this plugin. Can we please update these before the end of the year and this no longer works?

[15:56:25]: $ /Users/bmj1/Library/Android/sdk/platform-tools/adb devices
[15:56:25]: ▸ List of devices attached
[15:56:25]: ▸ emulator-5556 device
[15:56:25]: AVDs Booted!
[15:56:25]: Starting tests
[15:56:25]: Using gradle task.
[15:56:25]: $ ANDROID_SERIAL= ./gradlew connectedUATDebugAndroidTest
[15:56:27]: ▸ > Configure project :app
[15:56:27]: ▸ WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[15:56:27]: ▸ WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[15:56:27]: ▸ WARNING: API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variantOutput.getProcessManifest(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[15:56:27]: ▸ WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[15:56:27]: ▸ WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[15:56:27]: ▸ WARNING: API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variant.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[15:56:27]: ▸ WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
[15:56:27]: ▸ It will be removed at the end of 2019.
[15:56:27]: ▸ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[15:56:27]: ▸ To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

Unable to read AVD_setup.json. Check JSON file structure or file path.

Error : Unable to read AVD_setup.json. Check JSON file structure or file path.

I'm trying to use the plugin, but it seems that my path is always wrong.
I tried different paths and move the config file, but i'm always having the same error.

Exemple code
automated_test_emulator_run(
AVD_setup_path: "~/Projets/projectName/fastlane/AVD_configs/AVD_setup.json",
gradle_task: "connectedAndroidTest"
)

Here my config. json
{
"avd_list": [
{
"avd_name": "Test-Emulator-API23",
"create_avd_target": "android-23",
"create_avd_abi": "google_apis/x86",
"create_avd_hardware_config_filepath": "",
"create_avd_additional_options": "",

      "launch_avd_snapshot_filepath": "",
      "launch_avd_launch_binary_name": "emulator",
      "launch_avd_port": "",
      "launch_avd_additional_options": ""
    }
]

}

"Avd param loading took more than 60. Attempting to re-launch"

Its not able to launch more than 3 or 4 emulators on a mac mini. I am trying to launch 5 emulators with same configuration. I have given my HAXM around 11 gb memory (i can launch 5 emulators manually so memory is not an issue). It "waits for ADB to boot completed with success" for all the emulators and says "Avd param loading took more than 60. Attempting to re-launch", after launching 3 out of 5 emulators and tries to relaunch and is never able to launch, goes to a loop. Is it a good idea to have this timeout as a parameter too? or increase the timeout?

Performing wait for params: 'dev.bootcomplete', 'sys.boot_completed', 'init.svc.bootanim'

I am using plugin version 1.6.0 ADB boot gets completed with success but then it gets stuck at "Performing wait for params: dev.bootcomplete, sys.boot_completed, init.svc.bootanim."

My Config file looks like

{
"avd_list": [
{
"avd_name": "Nexus_6P_API_25",

  "create_avd_package": "system-images;android-25;google_apis;armeabi-v7a",
  "create_avd_device": "Nexus 6P",
  "create_avd_tag": "google_apis",
  "create_avd_abi": "armeabi-v7a",
  "create_avd_additional_options": "",
  "create_avd_hardware_config_filepath": "",

  "launch_avd_port": "",
  "launch_avd_snapshot_filepath": "",
  "launch_avd_launch_binary_name": "emulator",
  "launch_avd_additional_options": "-gpu off -no-window -no-audio"
}

]
}

I am running on AWS EC2 instance with Ubuntu 18.04

wait_for_param

Running Tests on Remote Emulator

Hello

Is it possible to run the Android Tests on a Remote Emulator?

I have a existing connection (adb connect ip_remote:host)

Somehow i should be able to configure this in the AVD_config.json

Thank you and kind regards!

Stefan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.