Friday, 1 January 2016

Android mobile automation - USB Troubleshooting

Issue 1: If command 'adb devices' is not detecting your android device.
Solution 1: 
    Check 'Developer options' is enabled in settings
    USB debugging is enabled.
    Mobile device drivers are installed in computer.


    Check 
     - 'Developer options' is enabled in settings and
     - USB debugging is enabled.
  
Now run the command 'adb devices', if still device details are not displayed.
Install mobile device drivers on your computer and check again by running command 'adb devices'.

Solution 2:
  Try with uncheck and check 'USB debugging'. 


Issue 2: Even after enabling 'developer options', 'usb debugging' and 'phone drivers are installed'. If the issue is not resolved, try with 'updating driver software' in 'device manager'.
Solution:
  Search for 'device manager'.

perform 'Update Driver Software'.



Issue 3: If command 'adb devices' is not working or not showing the device information, then try with below adb commands in command prompt.
Solution:
   adb kill-server
   adb start-server
   adb devices


Issue 4: Check USB cable.
Solution 1:
  Disconnect and re-connect usb cable to Computer and Phone.  

Solution 2:  
   If your device is not detected, unplug the usb cable and connect it to different usb socket on your computer. 

Solution 3:
Make sure both ends of USB cable are properly connected to computer and mobile device.

Solution 4:
Some time due to loose USB connectivity, usb may not be recognized.
Push usb cable up and down slightly(be careful while doing this, it may bent completely).
Note: This approach is not recommended.


Issue 5: Phone isn't detected via USB, but still charges.
Solution 1:
    Go to dial pad & type *#0808#
    It displays USB settings
    Select MTP+ADB option
    Press OK button
    Connect to USB cable to PC
    It shows Connected as a media device.



Solution 2:
I got this problem(i.e. phone is charging, but usb is not recognized), tried with all possible solution but usb is not recognized in 'Windows 7 Professional' Operating System.

Below popup appears when usb is connected to computer.

Based on the workaround provided in youtube, changed the USB cable(i.e. replace with new USB cable) and the issue got resolved, this is mainly due to the cheap USB cables.
  
Issue 6: If adb commands not working i.e. 'adb kill-server', 'adb start-server' and 'adb devices'.
Solution:


check if old adb server is running
Run the command 'tasklist | findstr /i adb' in command prompt.

If adb server is still running, then kill the process by running the command "taskkill /f /im adb.exe".

Check if anything is listening on port 5037, by running command 'netstat -ano | findstr :5037'

If process it not killed, then kill the process in task manager.
Restart computer and mobile device.

Referencehttps://code.google.com/p/android/issues/detail?id=184713

Issue 7: If multiple usb drivers are installed.
Solution:
If different USB devices are plugged-in (or) many users plug in different usb devices like pen drives, cameras, etc. then multiple usb drivers are installed on your computer, your computer doesn't know 'what' it is (i.e.android phone). 

Uninstall all inactive drivers.

Add the 'System Variable' with name 'devmgr_show_nonpresent_devices' and value '1'.


Search for 'Device Manager' and click on 'Device Manager'. 

Click 'View' >> 'Show hidden devices'.

Expand 'Universal Serial Bus controllers'.
Note: In above screenshot some of the driver software's are already uninstalled before taking the screenshot. 

Uninstall driver software's for inactive devices(drivers which are faded).

Search for file 'INFCACHE.1' and delete the file.
'INFCACHE.1' file is found at location 'C:\Windows\System32\DriverStore'.

Add 'Administrators' in Security tab to delete the file 'INFCACHE.1'.



Check 'Administrators' is having full permissions.

Now delete the file 'INFCACHE.1'. 

Restart computer and mobile device. Connect usb, file 'INFCACHE.1' is re-created once the usb is recognized. 

Reference:


Other Reference:

No comments:

Post a Comment