Closed youssefehaab closed 2 months ago
Can you confirm this issue applies to Docker Compose and is not a more global Docker issue? Try running the same container with a plain docker run ...
command to confirm you don't get the same issue
@ndeloof It is indeed a global Docker issue. I have tried running
docker run \
-v /Users/.m2:/home/myuser/.m2 \
-e ANDROID_ADB_SERVER_ADDRESS=host.docker.internal \
--network host \
--privileged \
--hostname localhost \
{IMAGE_NAME}
and I still face the same issue. Should I move this issue to another repo?
please report to github.com/moby/moby or maybe https://github.com/docker/for-mac as this may be specific to Docker Desktop
Description
I am trying to containerize E2E test automation, which automates a Flutter application on real Android devices. I managed to connect to the host's ADB daemon to establish the mobile device connection. While I was successful in connecting to the ADB, I was unsuccessful in connecting to UiAutomator2.
Here's how it works:
The issue is that, for example, before I run the container, I have a port in use (8081). When the container starts, I am able to curl on this port from the container's bash. However, I am not able to curl on port 8201, which was created by the UiAutomator2 driver from within the container.
Steps To Reproduce
Create docker image and include:
Compose Version
Docker Environment
Anything else?
[ADB] Running '/usr/lib/android-sdk/platform-tools/adb -P 5037 -s RR8W802EFNN install -r -g /home/myuser/app-debug.apk' [ADB] The installation of 'app-debug.apk' took 7979ms [ADB] Install command stdout: Performing Streamed Install [ADB] Success [AndroidUiautomator2Driver@9de5 (9d152cd0)] Performing shallow cleanup of automation leftovers [AndroidUiautomator2Driver@9de5 (9d152cd0)] No obsolete sessions have been detected (connect ECONNREFUSED 127.0.0.1:8200) [ADB] Running '/usr/lib/android-sdk/platform-tools/adb -P 5037 -s RR8W802EFNN shell am force-stop io.appium.uiautomator2.server.test' [AndroidUiautomator2Driver@9de5 (9d152cd0)] Starting UIAutomator2 server 5.12.16 [AndroidUiautomator2Driver@9de5 (9d152cd0)] Using UIAutomator2 server from '/home/myuser/.appium/node_modules/appium-flutter-driver/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v5.12.16.apk' and test from '/home/myuser/.appium/node_modules/appium-flutter-driver/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' [AndroidUiautomator2Driver@9de5 (9d152cd0)] Waiting up to 30000ms for UiAutomator2 to be online... [ADB] Creating ADB subprocess with args: ["-P","5037","-s","RR8W802EFNN","shell","am","instrument","-w","-e","disableAnalytics","true","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"] [AndroidUiautomator2Driver@9de5 (9d152cd0)] Matched '/status' to command name 'getStatus' [AndroidUiautomator2Driver@9de5 (9d152cd0)] Proxying [GET /status] to [GET http://127.0.0.1:8200/status] with no body [AndroidUiautomator2Driver@9de5 (9d152cd0)] connect ECONNREFUSED 127.0.0.1:8200 [AndroidUiautomator2Driver@9de5 (9d152cd0)] Matched '/status' to command name 'getStatus' [AndroidUiautomator2Driver@9de5 (9d152cd0)] Proxying [GET /status] to [GET http://127.0.0.1:8200/status] with no body [AndroidUiautomator2Driver@9de5 (9d152cd0)] connect ECONNREFUSED 127.0.0.1:8200