Tuesday 11 June 2019

Troubleshooting - Unable to detect device using adb devices

Unable to detect device using adb devices
There could be many situations where your device connected to system is not detected. Few of the scenarios are explained below. Apart from below scenarios if you face any trouble let us know in comment section.

1. adb devices command doesn't display any result.

For this problem you have to enable the developer option available at Setting -> More settings -> About Phone -> Tap five times on the Software version. A toast message is displayed that "Its in developer mode". Please refer adb devices page for details.
Step 1. Developer Mode selected
Step 2. Developer option is available
Step 3. USB debugging enabled

Once the debugging mode is enabled, now if you fire adb devices command, it will display below as still RSA key is not mapped and device shows us unauthorized



Fig 4. Device Unauthorized



Fig 5. RSA key pop up


Fig 6. Select the option as always



Fig 7. Device detected

2. Device not detected when connected to laptop

There could one reason here that in android 7 onward devices are connected in charge only mode. So you need to select the option from usb charge only to file transfer



 So once the Files mode is selected your device get detected.

3. Device not detected even though its mass storage is detected.

So there are situations in which device internal storage is detected but adb devices command returns nothing. For such scenarios please check below solution. Here we have considered ubuntu OS.

Step 1 : adb devices
This returns nothing

Step 2: lsusb
Once you run this command below result is displayed


Step 3: Check whether adb_usb.ini file exist on your system. In my case it was not available so we will install it with below commands
a. mkdir --parent $HOME/.android
b. wget -O $HOME/.android/adb_usb.ini https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/android/adb_usb.ini
c. vi adb_usb.ini
d. add the device code here and save
e. To save press Esc : wq

Step 4 : Once adb_usb.ini file is downloaded, add the code in the file and save


Fig 1. Downloaded adb_usb.ini


Fig 2. Added the code for mediatek device

Step 5 : Now run the adb devices command. Your device will be detected.

Why this happens?

The android sdk have qualcomm based codes already in the adb_usb.ini file, but for few other chipset it is not available then we have to add manually and save.

No comments:

Post a Comment

Feature Posts

Python Appium - Step by step procedure for capturing screenshot

 Why To capture screenshot? It is as important as your logs. If there is any failure for any test scenario, we can provide screenshot for th...