Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADB parallelization #6

Closed
nicopsz opened this issue Apr 28, 2017 · 4 comments
Closed

ADB parallelization #6

nicopsz opened this issue Apr 28, 2017 · 4 comments

Comments

@nicopsz
Copy link

nicopsz commented Apr 28, 2017

Hi,

First of all, thanks you for your work and amazing explanation vbanthia.

I have created a docker for Appium and Appium Python Client to execute my tests.

Everything works right but I have a problem with ADB when I tried to execute my test in two devices at the same time.

It seems that ADB Server of the first docker catchs the two devices and the ADB Server of the second docker can´t visualize the devices.

Is there a way to execute one test at the same time in two devices in parallel?

In your explanation, you say that you can create containers with different devices but you don´t specify if you can in parallel.

Thanks you so much.

@vbanthia-zz
Copy link
Owner

vbanthia-zz commented May 3, 2017

One solution has been mentioned here, #5

Basically the problem is all usb devices are mounted on host at /dev/bus/usb. When you do -v /dev/bus/usb:/dev/bus/usb, first container gets all the devices and second one gets nothing. So, solution will be to give one container only one device, which may be possible by -v /dev/bus/usb/xxx/yyy:/dev/bus/usb/xxx/yyy. Where xxx is Bus Number and yyy is Device Number as mentioned in #5

I have not tested this solution, so not sure if it will work or not but most probably it should.

One better solution, I will suggest to use openstf. Not very difficult to setup. openstf provides REST API to connect remote devices using adb connect $REMOTE_URL.

If you want to try it with docker, just call openstf remote api first before starting appium in your container and it will be good to go.

Some references:

  1. https://github.com/openstf/stf-appium-example
  2. https://github.com/vbanthia/docker-appium/tree/stf/appium-stf

@nicopsz
Copy link
Author

nicopsz commented May 3, 2017

Thanks you very much for your response.

The first solution works perfectly. I have executed the test in two devices in parallel.

We know openstf and it´s very useful for us. However, for our project, we use only adb-kit ( https://github.com/openstf/adbkit ) to know which devices are connected in the pc-host. The issue with the docker is the same that I have mentioned.

We have a ADB Server in the host and when we execute the docker, the devices wasn´t found because the ADB Server in the host catchs the devices. Any solution for that?

Or the best solution is to manage the bus and devices in Linux with lsusb without install ADB Server in the host?

Sorry if you don´t understand me, I think is complicated to explain it.

Thanks you very much again, regards.

@vbanthia-zz
Copy link
Owner

I guess better not to install adb on host server. In case if it is install, make sure adb server is off by running adb kill-server before running the docker.

@nicopsz
Copy link
Author

nicopsz commented May 3, 2017

Ok, I had thunk that. Thanks you very much for your help.

@nicopsz nicopsz closed this as completed May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants