HQarroum / docker-android

🤖 A minimal and customizable Docker image running the Android emulator as a service.
MIT License
90 stars 14 forks source link

Device Unauthorized when using IMG_TYPE=google_apis_playstore #2

Open lucasaas98 opened 1 year ago

lucasaas98 commented 1 year ago

Issue

I am following the readme as I am interested in creating an android emulator with playstore. The idea is that I would be able to run scrcpy to check the output. However, I keep getting the following error:

adb connect <IP>:5555
failed to authenticate to <IP>:5555

and with scrcpy:

scrcpy
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
ERROR: Device is unauthorized:
ERROR:     --> (tcpip)    <IP>:5555      unauthorized
ERROR: A popup should open on the device to request authorization.
ERROR: Check the FAQ: <https://github.com/Genymobile/scrcpy/blob/master/FAQ.md>
ERROR: Server connection failed

Steps followed:

docker build \                                                                                                                                 
  --build-arg API_LEVEL=28 \
  --build-arg IMG_TYPE=google_apis_playstore \
  --build-arg ARCHITECTURE=x86 \
  --tag android-emulator .

docker run -it --rm --device /dev/kvm -p 5555:5555 android-emulator

Problems found

scrcpy says:

ERROR: A popup should open on the device to request authorization.

And following their docs it says we can connect via usb to solve this with the flag --otg or we need to accept it in the device. In this case there is no device because it's an emulator.

The questions

  1. Is this expected?
  2. if yes, is there any way to accept the popup or connect to the emulator any other way to get around this?
  3. could we somehow create a virtual usb device and use scrcpywith --otg and connect that way? (it won't work if USB debugging isn't enabled by default)
faprobst commented 6 months ago

@lucasaas98 Did you ever figure this out? I am having the same issue, cannot get ADB to connect with authentication. I have copied the ADB keys and I have tried manually marking SKIP_AUTH = true

lucasaas98 commented 6 months ago

@lucasaas98 Did you ever figure this out? I am having the same issue, cannot get ADB to connect with authentication. I have copied the ADB keys and I have tried manually marking SKIP_AUTH = true

@faprobst nope, didn't even bother to try

PracticeofEno commented 5 months ago

I had the same symptom, so I googled it and found that the problem was caused by adbkey mismatch. When I ran scrcpy with the -v /root/.android /root/.android option, scrcpy was executed.

truongphung12947 commented 4 months ago

I had the same symptom, so I googled it and found that the problem was caused by adbkey mismatch. When I ran scrcpy with the -v /root/.android /root/.android option, scrcpy was executed.

@PracticeofEno May I ask how can you connect using scrcpy? I have the same issue, even with pre-build docker image with mounted keys. I'm not sure what do you mean when you ran scrcpy with -v option