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

I got error when I try to use the appium inspector. #160

Closed
foxmari opened this issue Jun 12, 2023 · 1 comment
Closed

I got error when I try to use the appium inspector. #160

foxmari opened this issue Jun 12, 2023 · 1 comment

Comments

@foxmari
Copy link

foxmari commented Jun 12, 2023

Hello.
Please help me!

I am trying to start the appium server with docker on MacOS (Monterey)and connect it to the appium inspector started on the host PC.
When I start the appium server and click the start session button on the appium inspector, I get this error

### I am excerpting errors that seem particularly relevant, but I will attach the full log later (log.txt)

appium_container  | [debug] [AndroidUiautomator2Driver@db8e (a907cb1f)] No app capability. Assuming it is already on the device
appium_container  | [debug] [AndroidUiautomator2Driver@db8e (a907cb1f)] Performing shallow cleanup of automation leftovers
appium_container  | [debug] [AndroidUiautomator2Driver@db8e (a907cb1f)] No obsolete sessions have been detected (connect ECONNREFUSED 127.0.0.1:8200)
...
appium_container  | [debug] [AndroidUiautomator2Driver@db8e (a907cb1f)] Matched '/status' to command name 'getStatus'
appium_container  | [debug] [AndroidUiautomator2Driver@db8e (a907cb1f)] Proxying [GET /status] to [GET http://127.0.0.1:8200/status] with no body
appium_container  | [AndroidUiautomator2Driver@db8e (a907cb1f)] connect ECONNREFUSED 127.0.0.1:8200

log.txt
(The actual udid is entered as the ID confirmed by the adb devices command, but it is replaced with dummy data when taking this log file.)

Here is the docker-compose file I used to start this container.

version: '3'
services:
  appium:
    image: appium/appium
    container_name: appium_container
    environment:
      - ADB_SERVER_SOCKET=tcp:host.docker.internal:5037
      - ANDROID_ADB_SERVER_ADDRESS=host.docker.internal
      - ANDROID_ADB_SERVER_PORT=5037
      - ANDROID_HOSTNAME=host.docker.internal:8200
    volumes:
      - /dev/bus/usb:/dev/bus/usb
    ports:
      - "4723:4723"
      - "8200:8200"
    privileged: true
    extra_hosts:
      - "host.docker.internal:host-gateway"

Attached is a screenshot of the appium inspector settings screen.
スクリーンショット 2023-06-12 10 55 23
(The actual udid is entered as the ID confirmed by the adb devices command, but it is replaced with dummy data when taking the screenshot.)

And, the adb devices command works inside the container, but will not work if the environment variable is not set.
ADB_SERVER_SOCKET=tcp:host.docker.internal:5037

Incidentally, if I enter /wd/hub in the Remote Path on the configuration screen of the appium inspector to start a session, a 404 error is returned.
スクリーンショット 2023-06-12 11 17 34

log2.txt

Docker host OS is macOS (Monterey),My docker runtime is colima.

I think I have specified the necessary parameters as much as possible, but I think they are not enough.
Can I use this container with a MacBookPro?
Please help me...!

This is my first time writing a github issue, so I apologize if I am rude.
Thank you.

@spartan-khanhtruong
Copy link

image

@foxmari

If Appium client code encounters difficulties connecting to the Appium server during testing, ensure that the host in the capabilities section of the client code is set to host.docker.internal.

refer to #140 (comment)

@budtmo budtmo closed this as completed May 3, 2024
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

3 participants