appium-docker-android icon indicating copy to clipboard operation
appium-docker-android copied to clipboard

Unable to run tests through remote ADB

Open davirss opened this issue 6 years ago • 8 comments

Hello!

I was able to successfully set up Appium-Docker as a node for my Selenium Grid. And I'm also using a remote ADB Server for the devices. Running "ADB devices" inside the container I'm able to check that the container can communicate with the devices.

image

However, when running the tests, appium keeps restarting the ADB server and its not able to list the devices.

image

Does anyone have any idea why this is happening?

My Environment:

  • Windows x64 Machine Hyper-V Enabled
  • Docker Version 2.1.0.5
  • Both Container and ADB Server is in the same machine

My yaml file

version: "3"
services:
  selenium-hub:
    image: selenium/hub:3.141.59-xenon
    container_name: selenium-hub
    ports:
      - "4444:4444"
  chrome:
    image: selenium/node-chrome:3.141.59-xenon
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
  firefox:
    image: selenium/node-firefox:3.141.59-xenon
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
  appium_android_device:
    image: appium/appium
    depends_on:
      - selenium-hub
    privileged: true
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - ~/.android:/root/.android
    environment:
      - ADB_SERVER_SOCKET=tcp:host.docker.internal:5037
      - APPIUM_HOST=appium_android_device
      - CONNECT_TO_GRID=true
      - SELENIUM_HOST=selenium-hub
      #- CUSTOM_NODE_CONFIG=true
      - BROWSER_NAME=chrome

If any info is missing, let me know.

davirss avatar Nov 20 '19 11:11 davirss

+1

cyberbudy avatar Feb 17 '20 15:02 cyberbudy

any update on this please? Experiencing the same issue

mcopjan avatar Mar 17 '20 16:03 mcopjan

docker run --privileged -it -p 4723:4723 -v /Users/xxxxxx/Shared/nodeconfig_emulator-5554.json:/root/nodeconfig.json -e "CONNECT_TO_GRID=true" -e "CUSTOM_NODE_CONFIG=true" -e "ADB_SERVER_SOCKET=tcp:IP:5555" --name "appium" appium/appium:latest

docker exec -it appium adb devices List of devices attached emulator-5554 device

adbNoDevices.txt

mcopjan avatar Mar 17 '20 16:03 mcopjan

any update on this please?

mcopjan avatar Apr 12 '20 20:04 mcopjan

having the same issue

rohitworld90 avatar May 11 '20 12:05 rohitworld90

after digging around at cs.android.com I came up with the following workaround:

replace ADB_SERVER_SOCKET=tcp:host.docker.internal:5037 with ANDROID_ADB_SERVER_ADDRESS=host.docker.internal and if using a non default port also set ANDROID_ADB_SERVER_PORT

https://cs.android.com/android/platform/superproject/+/master:system/core/adb/client/commandline.cpp;l=1616?q=ADB_SERVER_SOCKET

trevjonez avatar May 20 '20 22:05 trevjonez

Hi, I’m facing the same issue with docker container

Did anybody was able to fix that ?

start-server'[ADB] Error killing ADB server, going to see if it's online anyway [debug] [ADB] Getting connected devices [debug] [ADB] Could not find online devices [debug] [ADB] Reconnecting adb (target offline) [debug] [ADB] Running '/usr/local/android-sdk/platform-tools/adb -P 5037 reconnect offline' [debug] [ADB] Restarting adb [debug] [ADB] Killing adb server on port '5037' [debug] [ADB] Running '/usr/local/android-sdk/platform-tools/adb -P 5037 kill-server' [debug] [ADB] Running '/usr/local/android-sdk/platform-tools/adb -P 5037 start-server'`

menvol3 avatar Mar 31 '21 10:03 menvol3

Hey,

does someone know how to fix the adb.cpp:112 {device}" offlone issue?

maxbarsuk avatar Oct 24 '21 07:10 maxbarsuk

close the issue as it might be fixed on the newest release. feel free to reopen the issue if the error still there

budtmo avatar Feb 01 '23 12:02 budtmo