3

We are doing automation testing on mobile devices with Appium but testing fails because of the popup 'Allow USB debugging' even though the device is already connected through 'adb connect' and 'adb devices.' I already checked the 'Always allow from this computer' but sometimes the popup would occur causing the test to fail and sometimes it will pass when it will not show up. Can someone enlighten me on how to address this issue?

2

In my case, I was continually getting prompted with one fingerprint. I revoked all debugging permissions and next time the dialog popped up, I noticed the fingerprint had changed. So far I haven't been prompted again.

So: try revoking all debug permissions and then allowing USB debugging again.

0

One possibility for this problem may be located on PC side: May be you are running multiple adb daemons with different private keys. The private key is used for identifying the "this computer".

Another possibility would be a problem on device side that e.g. the adb server crashes and losses the data on previous authorized computers. Or it may be a bug in adb that causes the identification of the computer to fail.

  • Problem with the USB port or the the cable can also does that. It used to be the case with my Nexus 6 (bad port, bad cable) but this is unlikely the case for OP though. – Firelord Feb 14 at 16:55
  • Thank you @Robert for this one. I will sure to check it on my side. But i am using my pc that is connected to the mobile device with a usb cable. Regarding on the another possibility, should i have a checker to check every execution whether the RSA key of the computer is already authorized to the mobile device then add it otherwise? – Gel Feb 15 at 3:07
  • Yes @Firelord, I also think that it may be because of the usb cable that caused the loss of connection but I have a checker to execute adb devices to check if there's a connection before executing the test. It says that it is connected but it will fail in creating the mobile capabilities in Appium. So that's what I am wondering about as to why it failed when it says that it is already connected. Then it also prompts the 'Allow usb debugging' even though I already checked the 'Always allow in this computer' – Gel Feb 15 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.