Adb and several devices at the same time

I can automate some tests on Android devices. I use Jenkins to conduct tests (through tasks), each task is completed with a 95% success rate when only 1 device is connected to the device but when I connect 2 or more Android devices, it seems that adb has some problems and I get 5% -th chance of success.

Can I run multiple instances of the adb command?

here is the command that I run for each job:

adb -s DEVICESERIAL shell am force-stop com.myapp.test adb -s DEVICESERIAL shell am force-stop com.myapp adb -s DEVICESERIAL uninstall com.myapp adb -s DEVICESERIAL uninstall com.myapp.test adb -s DEVICESERIAL install -r com.myapp adb -s DEVICESERIAL install -r com.myapp.test adb -s DEVICESERIAL shell am instrument -w TESTNAME/android.test.InstrumentationTestRunner adb -s DEVICESERIAL logcat -d -v time 

the whole team starts with success, but when the test starts and when I have several devices connected, I get errors such as:

 - Unable to find instrumentation target package - INSTRUMENTATION_STATUS_CODE: 0 - Failure [INSTALL_FAILED_INVALID_URI] 

At first I thought that the apk test was installed incorrectly, but when I tried manually after a failure, it worked fine (therefore, the test file is installed)

again. Using only 1 device, everything is stable.

Is there anything special to install and run the test on different devices at the same time?

Notice that I tried different USB ports, different cables, etc.

thanks

+4
source share
1 answer

Try connecting your second device wirelessly adb .... steps

  • Install the adb wireless connector on the device (works only with root devices).
  • open cmdprmpt> \ sdk \ platform-tools \ adb connect yourip: 5555
  • Run! You can see the wireless connected device.
-1
source

Source: https://habr.com/ru/post/1484893/


All Articles