Closed abayibrayev1 closed 3 years ago
@abayibrayev1 Selenoid should work with any Android image with Selenium \ Appium inside. Our images by default have no Google APIs but you can build your own using this script: https://github.com/aerokube/images/blob/master/selenium/automate_android.sh
Thanks for the fast reply, I solved my problem successfully with automate_android.sh script. Thanks a lot!
@abayibrayev1 . Hi, may I know what values did you select when you run the automate_android.sh script? like what android version,appium version, android image you select?, because I am also encountering the same issue but when I tried to build an image using the automate_android.sh script, the image is created but I can't create a session or can't run the image emulator .
These are the dd values I selectected: appium version: 1.18.1 android version : 9.0 android image type : google_apis_playstore device: Nexus 5/ Nexus 5X image tag : selenoid/android:9.0
@abayibrayev1 . Hi, may I know what values did you select when you run the automate_android.sh script? like what android version,appium version, android image you select?, because I am also encountering the same issue but when I tried to build an image using the automate_android.sh script, the image is created but I can't create a session or can't run the image emulator .
These are the dd values I selectected: appium version: 1.18.1 android version : 9.0 android image type : google_apis_playstore device: Nexus 5/ Nexus 5X image tag : selenoid/android:9.0
Hello, sure, but i remember only this values: Android version 8.1 Android image type google_apis Device default Appium version default No quick boot
It worked for me, so I hope it will help u to solve u problem
Hi @abayibrayev1 , thanks so much for your response, I tried the same details that you have mentioned, unfortunately I still can't create session, these are errors that I encountered in the container logs when I tried to create session. Not sure if the selenoid docker version can also be the reason, but still, thanks for your help :)
Waiting X server... Waiting X server... Logging to: /tmp/fluxbox.log Waiting X server... Waiting X server... Waiting X server... Waiting X server... Waiting X server... Waiting X server...
--- x11vnc loop: 1 ---
PORT=5900 adb: no devices/emulators found adb: no devices/emulators found adb: no devices/emulators found adb: no devices/emulators found adb: no devices/emulators found adb: no devices/emulators found adb: no devices/emulators found handleCpuAcceleration: feature check for hvf cannot add library /opt/android-sdk-linux/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed added library /opt/android-sdk-linux/emulator/lib64/vulkan/libvulkan.so cannot add library /opt/android-sdk-linux/emulator/lib64/vulkan/libvulkan.so.1: full adb: no devices/emulators found WARNING. Using fallback path for the emulator registration directory. emulator: WARNING: System image is writable emulator: WARNING: userdata partition is resized from 500 M to 800 M
emulator: INFO: GrpcServices.cpp:288: Started GRPC server at 127.0.0.1:8554, security: Local Your emulator is out of date, please update by launching Android Studio:
adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline adb: device offline
Hi @abayibrayev1, May I know how did you setup the selenoid hub? . Did you use the cm by selenoid or you manually setup a hub using docker and add the generated emulator image there? Because when I am trying to run the emulator manually using docker I was able to connect to it using this :
docker run -d --name android-test -e ENABLE_VNC=true --privileged -p 4444:4444 -p 5900:5900 selenoid/android:8.1.
But the problem is that I want to connect this to the grid/selenoid hub for me to execute my test using RemoteURL. May I know the steps or documentation that you followed to setup the selenoid hub and generated emulator image?
Hi @abayibrayev1, May I know how did you setup the selenoid hub? . Did you use the cm by selenoid or you manually setup a hub using docker and add the generated emulator image there? Because when I am trying to run the emulator manually using docker I was able to connect to it using this :
docker run -d --name android-test -e ENABLE_VNC=true --privileged -p 4444:4444 -p 5900:5900 selenoid/android:8.1.
But the problem is that I want to connect this to the grid/selenoid hub for me to execute my test using RemoteURL. May I know the steps or documentation that you followed to setup the selenoid hub and generated emulator image?
Hi. sure. I configured selenoid + android images (without any appium configuration) on my local PC Ubuntu 20.04 (not remote). Here the steps, that i did:
I can't remember if I had any major issues, so I hope it will help u.
And my small advice, try firstly simply connect selenoid with default android emulators from docker hub, and after u will have completed flow (autotest -> selenoid hub -> emulator launch) then specify ur own images
Hi @abayibrayev1 , Thanks so much for the detailed instructions. This is really a great help for us. Thanks a lot :)
Hi @JaysonAbilar . Is your problem solved? as we still facing the same issue looking on docker logs:
Waiting X server... Waiting X server... Waiting X server... Waiting X server... Waiting X server... Waiting X server...
We used this instruction https://github.com/TimurNurlygayanov/test-tasks-example/blob/master/selenoid-android/README.md as we need playstore support
Appium version: 1.18.1 Android image type: google_apis_playstore Application Binary Interface: x86 Android Version: 9.0 image tag: android9_google_play
Can be any compatibility issues between custom Android image that we create and Selenoid Server? Container is run and in queue but emulator still not running
@vania-pooh Ivan, hi. It would be great if you can recommend smth there
@AlexeyAltunin the problem is that when you enable play store, then during the boot of emulator you have to manually close a dialog related to USB debugging if I remember correctly. And because of that nothing works. Did not do more research, probably there is a property allowing to suppress this dialog.
@AlexeyAltunin the problem is that when you enable play store, then during the boot of emulator you have to manually close a dialog related to USB debugging if I remember correctly. And because of that nothing works. Did not do more research, probably there is a property allowing to suppress this dialog.
Ivan, thanks. We will try to research in this direction as well . But when we run container separately without Selenoid to do google auth:
docker run -d --name android-test -e ENABLE_VNC=true --privileged -p 4444:4444 -p 5900:5900
It worked fine
I finally found and fixed the issue. It was our mistake.
When we created a custom image with google play we used this instruction: https://github.com/TimurNurlygayanov/test-tasks-example/blob/master/selenoid-android/README.md
There was a step
- Connect to VNC on localhost:5900, run Google Play service, authorize with your google account. When we launched simulator , it created a file /tmp/.X99-lock . After that we saved our custom image, including the file.
After launching a container via Selenoid there was a message:
Fatal server error: (EE) Server is already active for display 99 If this server is no longer running, remove /tmp/.X99-lock and start again. Waiting X server... Waiting X server... Waiting X server...
So, the first step was removing the file /tmp/.X99-lock , otherwise it will say that 99 is already active The second that you need to do is killing the emulator adb -s emulator-5554 emu kill , otherwise when you run via Selenoid you will get a message
Running multiple emulators with the same AVD is an experimental feature. Please use -read-only flag to enable this feature.
And only after that you can save a custom image!
using selenoid + docker image (selenoid/android:9.0) https://registry.hub.docker.com/r/selenoid/android
Facing problem with google play services
Tried to use other docker images, but can't configure them with selenoid.
Can u please tell me: 1) how can I configure google play services before starting emulator in selenoid? 2) does selenoid able to work with other docker android images (with google APIs) ?
Thanks in advance!