Giter Club home page Giter Club logo

Comments (12)

FisherKK avatar FisherKK commented on June 26, 2024

Hey @semenovalexander!
Thank you for your feedback.

Indeed we shared version of plugin that we used for our own needs and we use MacOS only.

It's hard for me to say something as I we do not use Ubuntu and I can't reproduce this issue so easily.

Can you elaborate more about "ruby processes/threads instead of subshell"?
Do you have any idea, that you know, would fix the issue?

From my perspective you need to communicate win Android SDK binaries via shell so what's the difference if I call it from various threads if it still needs to be shell - and its shell that is running and managing processes, plugin is only sending commands.

Other thing that comes to my head is that those AVD are launched simultaneously and maybe Ubuntu is less tolerant for this?
Can you check if you can launch single AVD instead of two?

I am willing to help.

from fastlane-plugin-automated-test-emulator-run.

OSemenovBoyarka avatar OSemenovBoyarka commented on June 26, 2024

@FisherKK Thanks for such quick response!

Yeap, I've also thought about two adb instances clashes each other, but running single emulator is the same. Line "Waiting AVD to boot..." doesn't appear.

Before using your plugin, we've wrote small ruby method and attached it just as another Fastfile, it's quite limited and has a lot of hardcode, but key point is using Process.fork to launch emualtor
https://gist.github.com/SemenovAlexander/c1e74f73402ab0ab511c57e404fe7cd0#file-androidemulatorfastfile-L26

Like so - it works fine, one issue here - that emulator doesn't get killed, when shell is closed, so we kill it with adb emu kill at the end.

For now we've reverted to this approach and all works fine.

from fastlane-plugin-automated-test-emulator-run.

FisherKK avatar FisherKK commented on June 26, 2024

Thats interesting and helpful information.

Seems like not much work to do. I would need to wrap launch commands in this and it would help I guess.

I am killing emulators with adb emu kill too. If I get some free time (I think tomorrow or today after my work time) I will try to apply this and check if it doesn't crash anything on my side. I hope it will fix it for you.

From the other side I am waiting for Google to fix issues with new emulator binaries which started since Build Tools 25.0.2 Emulators tend to launch as "unauthorized" and you can't do anything with them until you restart ADB. It's blocker for tools like this.

from fastlane-plugin-automated-test-emulator-run.

OSemenovBoyarka avatar OSemenovBoyarka commented on June 26, 2024

Thanks for that!

As for Unauthorized issue, we've updated build tools from 24.x to 25.3.1 at once, and have no issues with emulator across >100 launches in couple days.

May, they have fixed this already?

from fastlane-plugin-automated-test-emulator-run.

FisherKK avatar FisherKK commented on June 26, 2024

Huh, are you sure you didn't mean SDK Tools? I had 25.3.1 too (just saw that 26.0.0 are available) for Android SDK Build-Tools (new binary -> avdmanager is included there) I have 25.0.2 as latest version and I can't download anything newer.

from fastlane-plugin-automated-test-emulator-run.

OSemenovBoyarka avatar OSemenovBoyarka commented on June 26, 2024

Yes, I'm pretty sure, they've added new dependency Android Emulator, I have now 25.3.1 on all machines and yes, update available to 26.0.0, but I'm afraid to update that since it works now :)

Sorry, about confusing Build Tools, it should be Android Emulator

Btw, forgot to mention, with this new Android Emulator you should now launch emulator from emulator/emulator directory, not from tools/emulator, as release notes mention.
https://developer.android.com/studio/releases/emulator.html

screen shot 2017-03-28 at 13 00 56

from fastlane-plugin-automated-test-emulator-run.

FisherKK avatar FisherKK commented on June 26, 2024

Well I need to make update in plugin anyway then :P

from fastlane-plugin-automated-test-emulator-run.

FisherKK avatar FisherKK commented on June 26, 2024

Heh, I have updated to 26.0.0 and I can say that "unauthorized" has disappeared but AVD creation time went up rly much.

Check out this log (it's not from plugin it's other tool I am working on):

[13:56:10] - DeviceManager: AVD with name 'Test-Emulator-API23-Nexus-5-0' already exists and will be re-created.
[13:56:10] - ShellHelper: Executing shell command: /Users/F1sherKK/Library/Android/sdk/tools/bin/avdmanager delete avd -n Test-Emulator-API23-Nexus-5-0
[13:56:11] - Deleting file /Users/F1sherKK/.android/avd/Test-Emulator-API23-Nexus-5-0.ini
[13:56:11] - Deleting folder /Users/F1sherKK/.android/avd/Test-Emulator-API23-Nexus-5-0.avd
[13:56:11] - 
[13:56:11] - AVD 'Test-Emulator-API23-Nexus-5-0' deleted.
[13:56:11] - ShellHelper: Executing shell command: echo "no" | /Users/F1sherKK/Library/Android/sdk/tools/bin/avdmanager create avd --name "Test-Emulator-API23-Nexus-5-0" --package "system-images;android-23;google_apis;x86_64" --device "Nexus 5X"  --abi google_apis/x86_64 
[13:56:26] - DeviceManager: 'config.ini' file was specified in AVD schema of device 'emulator-5556 in location '~/Android/AVD_Snapshots/Nexus_5X_API_23/config.ini'. Applying...
[13:56:26] - DeviceManager: AVD with name 'Test-Emulator-API23-Nexus-5-1' already exists and will be re-created.
[13:56:26] - ShellHelper: Executing shell command: /Users/F1sherKK/Library/Android/sdk/tools/bin/avdmanager delete avd -n Test-Emulator-API23-Nexus-5-1
[13:56:28] - Deleting file /Users/F1sherKK/.android/avd/Test-Emulator-API23-Nexus-5-1.ini
[13:56:28] - Deleting folder /Users/F1sherKK/.android/avd/Test-Emulator-API23-Nexus-5-1.avd
[13:56:28] - 
[13:56:28] - AVD 'Test-Emulator-API23-Nexus-5-1' deleted.
[13:56:28] - ShellHelper: Executing shell command: echo "no" | /Users/F1sherKK/Library/Android/sdk/tools/bin/avdmanager create avd --name "Test-Emulator-API23-Nexus-5-1" --package "system-images;android-23;google_apis;x86_64" --device "Nexus 5X"  --abi google_apis/x86_64 
[13:57:35] - DeviceManager: 'config.ini' file was specified in AVD schema of device 'emulator-5558 in location '~/Android/AVD_Snapshots/Nexus_5X_API_23/config.ini'. Applying...
[13:57:35] - DeviceManager: AVD with name 'Test-Emulator-API23-Nexus-5-2' already exists and will be re-created.
[13:57:35] - ShellHelper: Executing shell command: /Users/F1sherKK/Library/Android/sdk/tools/bin/avdmanager delete avd -n Test-Emulator-API23-Nexus-5-2
[13:57:36] - Deleting file /Users/F1sherKK/.android/avd/Test-Emulator-API23-Nexus-5-2.ini
[13:57:36] - Deleting folder /Users/F1sherKK/.android/avd/Test-Emulator-API23-Nexus-5-2.avd
[13:57:36] - 
[13:57:36] - AVD 'Test-Emulator-API23-Nexus-5-2' deleted.
[13:57:36] - ShellHelper: Executing shell command: echo "no" | /Users/F1sherKK/Library/Android/sdk/tools/bin/avdmanager create avd --name "Test-Emulator-API23-Nexus-5-2" --package "system-images;android-23;google_apis;x86_64" --device "Nexus 5X"  --abi google_apis/x86_64 
[13:59:22] - DeviceManager: 'config.ini' file was specified in AVD schema of device 'emulator-5560 in location '~/Android/AVD_Snapshots/Nexus_5X_API_23/config.ini'. Applying..

First AVD: 15 sec
Second AVD: 67 sec
Third AVD: 134 sec ???!

The same happens if I invoke raw commands in terminal, not from any script. I wonder if I should create ticket for it. Something seems to stack in background and next AVD takes much longer to create than previous one.

from fastlane-plugin-automated-test-emulator-run.

OSemenovBoyarka avatar OSemenovBoyarka commented on June 26, 2024

I can confirm this, tried to update to 26.0.0 on dev machine and first time I've tried to create AVDs times were something like yours.
However, I've noticed a lot of duplicated AVDs, left from previous launches. I've deleted them - and all seems to work fine

from fastlane-plugin-automated-test-emulator-run.

FisherKK avatar FisherKK commented on June 26, 2024

Well, as you can see in log I am deleting AVD and waiting for shell feedback with "action complete message" before I attempt to create an AVD - so for sure I am not making a copy of existing one there. Weird.

from fastlane-plugin-automated-test-emulator-run.

FisherKK avatar FisherKK commented on June 26, 2024

Hello @semenovalexander

I have changed emulator binary loc to emulator/ from tools/.
Furthermore I have wrapped launch AVD shell commands in Process.fork. It works on my side, tell me how it goes for you :)

New version is 1.4.1.

from fastlane-plugin-automated-test-emulator-run.

OSemenovBoyarka avatar OSemenovBoyarka commented on June 26, 2024

Yes, it works fine for me too now. Thanks a lot!

from fastlane-plugin-automated-test-emulator-run.

Related Issues (20)

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.