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

Doc for Windows #166

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Appium/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ ENV APPIUM_DRIVER_ESPRESSO_VERSION="2.29.2"
ENV APPIUM_DRIVER_FLUTTER_VERSION="2.2.2"
ENV APPIUM_DRIVER_GECKO_VERSION="1.2.9"
ENV APPIUM_DRIVER_UIAUTOMATOR2_VERSION="2.34.1"
ENV ANDROID_ADB_SERVER_ADDRESS="host.docker.internal"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need to put it inside the Dockerfile, but we can pass the variable on the fly, cant we? as User use different on OS and it seems it is needed only for Windows OS. Maybe you can write it in readme that this environment variable is needed for Windows OS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will fix this. Additionally, I will explore more, as currently, it is only confirmed to work with the UIAutomator2 Driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep in dive into the source code, I found that the capability appium:remoteAdbHost or appium:host both works.

Take UiAutomator2 driver as example:

The capability was used by uiautomator2Opts.host

the uiautomator2Opts.host was used by JWProxy

JWProxy use it to make request to the uiautomator-server running on android.

Espresso driver use the same logic.

https://github.com/appium/appium-espresso-driver/blob/3872085e9b8d6056ef655e364754e0488be49f40/lib/driver.js#L512

Flutter driver directly use UiAutomator2 .

https://github.com/appium/appium-flutter-driver/blob/330ab4b9745b36d84c3865c5d171eeb03cc6d558/driver/lib/sessions/android.ts#L9

RUN appium driver install --source=npm appium-espresso-driver@${APPIUM_DRIVER_ESPRESSO_VERSION} && \
appium driver install --source=npm appium-flutter-driver@${APPIUM_DRIVER_FLUTTER_VERSION} && \
appium driver install --source=npm appium-geckodriver@${APPIUM_DRIVER_GECKO_VERSION} && \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
}
```

5. For Windows users, it is essential to carefully consider the usage of `host.docker.internal`. This enables applications within the container to access resources on the host machine. When facing issues on the Windows platform, it is recommended to verify whether the connected Android device is inaccessible within the container. If so, contemplate configuring the pertinent options to utilize `host.docker.internal`. For additional details, refer to https://github.com/appium/appium-docker-android/issues/140.

## Additional configuration

### Share Android identification key
Expand Down