amrsa1 / Android-Emulator-image

The use of this Docker image simplifies the process of running an Android emulator within a Docker container
MIT License
83 stars 43 forks source link

I am trying to build using different emulator other than the default one which is provided in the documentation but getting Error #16

Closed moknit closed 5 months ago

moknit commented 5 months ago

Build an image $ docker build --build-arg ARCH=x86_64 --build-arg TARGET=google_apis_playstore --build-arg API_LEVEL=31 --build-arg BUILD_TOOLS=31.0.0 --build-arg EMULATOR_DEVICE="Pixel 7 Pro" --build-arg EMULATOR_NAME="pixel" -t my-android-image .

Getting the below Error

Error: No device found matching --device Pixel 7 Pro. null

How to find the correct EMULATOR_NAME for different devices?

amrsa1 commented 5 months ago

Build an image $ docker build --build-arg ARCH=x86_64 --build-arg TARGET=google_apis_playstore --build-arg API_LEVEL=31 --build-arg BUILD_TOOLS=31.0.0 --build-arg EMULATOR_DEVICE="Pixel 7 Pro" --build-arg EMULATOR_NAME="pixel" -t my-android-image .

Getting the below Error

Error: No device found matching --device Pixel 7 Pro. null

How to find the correct EMULATOR_NAME for different devices?

Did you manage to have sucessful build ?

moknit commented 5 months ago

$ docker exec --privileged -it androidContainer bash avdmanager list device

Ran the above command to show the list of devices and took the id for pixel 7 pro

$ docker build --build-arg ARCH=x86_64 --build-arg TARGET=google_apis_playstore --build-arg API_LEVEL=31 --build-arg BUILD_TOOLS=31.0.0 --build-arg EMULATOR_DEVICE="pixel_7_pro" --build-arg EMULATOR_NAME="pixel_7_pro" -t my-android-image .

The above EMULATOR_DEVICE name solved my issue

amrsa1 commented 5 months ago

Awesome glad to know that you got it solved!