I'm trying to debug with Android R in Pixel emulated devices w/ PlayServices but the "Allow USB Debugging" dialog instantly close right after showing, so I can't click in "Allow" to AS connect to the AVD. I went to Developer options in Android to switch off and on again the USB debugging, but again the dialog close imediatelly right after showing. I tried kill/star ADB and unistalling all AS/user configs/etc and reinstalling again but didn't solve. Anyone has a clue?
I had the same issue. I tried to click "Allow" in time, but it was too fast on my PC. However, I noticed that after a cold boot this popup pops and doesn't hide for some time (may be due to load lag), so I managed to click it this way.
If someone still has this problem and the goal is to upload some file or apk, better upload it to google drive and download it by link in the emulator.
Wipe data and it will pop up and stay. Check the "always allow debugging on this device" box and you should be good to go.
Seems like this issue is related to your emulator's API version, after some testing I found that Pixel 4 API 30 have your problem, while others don't.
Another odd thing about the box is that it will ask you again for permission when you start a new session, even though I clicked the "always allow this device" button.
Try remove files adbkey
and adbkey.pub
in:
~/.android/adbkey/
on Linux%UserProfile%\.android
on Windows%ANDROID_SDK_HOME%\.android
on Windows, if set
adb kill-server
adb devices
Restart the emulator after wiping its data. Then the permission for "USB Debugging" should be given and it should show up as debuggable device.
The problem should only appear with google_apis_playstore
devices, see here. Reason I think is, that the key files are only copied by adb, if no other keys already exist on the emulator. So may deleting the files on the emulator may also work.
ANDROID_SDK_HOME
or ANDROID_PREFS_ROOT
variable? Make sure any old keys are deleted in any possible .android
directory. If so, there shouldn't come up a dialog at all, the keys are then copied automatically to your device and you should be able to debug without confirming :) –
Syncom This problem occurs with Pixel emulators on API level 30, so choosing 31 instead will solve the issue.
- get your public key from
~/.android/adbkey.pub
- append it to
/data/misc/adb/adb_keys
of emulator (create it if not exist) - restart emulator
then you should connect directly.
ref: How to solve ADB device unauthorized in Android ADB host device?
I had the same issue. I tried to click "Allow" in time, but it was too fast on my PC. However, I noticed that after a cold boot this popup pops and doesn't hide for some time (may be due to load lag), so I managed to click it this way.
If someone still has this problem and the goal is to upload some file or apk, better upload it to google drive and download it by link in the emulator.
I solved this problem by following steps:
- Wipe emulator data
- Start emulator again
Above steps resulted in no dialog at all, weird, then I looked at the Android Studio, the emulator was already connected.
After some experiments I found that x86 apis were showing this error so simply switching to x86_64 apis solved the problem :
In my case, it was because I had enabled an accessibility app. At least, after trying various things (turning on/off developer mode, USB debugging, etc.;, rebooting and so on), I disabled that accessibility service, and voila, the "Allow USB debugging" was back to normal!
© 2022 - 2024 — McMap. All rights reserved.