Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - OnePlus does not work over ADB

I've been at this for a while. My issue is with using my OnePlus in order to run apps over ADB. As expected, when I connect my OnePlus without USB Debugging enabled, it is connected as a "Portable Device" in my Device Manager. However, when I turn on USB Debugging, the device "disconnects" from the computer altogether (I can't even access the files on it).

I've tried numerous tutorials and driver installers, all unsuccessful. I have the latest Android Studio along with the latest ADB drivers. If anyone could point me in the right direction, that would be much appreciated!

Update: The (ancient) Samsung Galaxy SII works properly when connected to my computer. I can only assume this is an issue with my OnePlus.

like image 630
mattrick Avatar asked Dec 21 '15 06:12

mattrick


People also ask

Why is adb devices not working?

Failed ADB connections usually have one root cause: bad Android USB drivers that load in place of the right ones. Windows doesn't make it easy to remove the wrong drivers, unfortunately. But before attempting to troubleshoot an ADB connection, first enable USB debugging on your phone if it's not on already.

How do I force adb to enable?

Enable adb debugging on your device On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom.

Why my phone is not showing in adb devices?

On Android 5.0, go to Settings -> Storage -> menu -> USB computer connection and make sure 'Media device (MTP)' is disabled. When it's disabled 'adb devices' lists the device, when enabled not.


5 Answers

I managed to resolve this problem, albeit after many hours, by following these really helpful instructions. I also had to put device into PTP mode, as mentioned by @mattrick in an earlier answer.

If you don't have Android SDK installed, please install it first.

  1. Open Start menu. Select Android SDK Tools -> SDK Manager.
  2. Right-click on it and select "Run as Administrator".
  3. Running SDK Manager as Administrator is very important. If you just click on it, the SDK manager will start, but will encounter errors when you try to install new components!
  4. In the SDK Manager select "Extras->Google USB Driver". Enable the checkbox and click "Install 1 Package".
  5. When the Google USB driver is installed, plug in your device. Warning: The driver won't install automatically. We will do it manually in the next steps.
  6. Open the System Properties dialog (press Win+Break on the keyboard or locate "Computer" in Start Menu, right-click on it and select "Properties".
  7. Click on the "Device Manager" link. In the Device Manager locate your Android device. Then right-click on it and select "Update Driver Software".
  8. Select "Browse my computer for driver software".
  9. Select "Let me pick from a list of device drivers on my computer".
  10. Select "Show All Devices".
  11. Press the "Have Disk" button.
  12. Enter the path to the Google USB driver. Normally it is located in the following directory:

C:\Program Files (x86)\Android\android-sdk\extras\google\usb_driver

  1. Select "Android ADB Interface" from the list of device types.
  2. Confirm the installation of the driver by pressing "Yes".
  3. Confirm the installation again by pressing "Install".
  4. When the installation is done, press "Close".

Hope this helps! Here's my source: visualgdb.com

like image 145
Bexolo Avatar answered Oct 23 '22 03:10

Bexolo


I got it to work:

It turns out when your device is connected through Media Device (MTP), ADB will not be able to communicate. In this case, you have to connect as a Camera (PTP) for it to work. Super annoying, but an easy fix if anyone happens to have this same issue.

like image 31
mattrick Avatar answered Oct 23 '22 04:10

mattrick


I think the problem is due to ADB driver.

I also faced the same problem with micromax tab.

Try universal ADB driver. Install it and check.

like image 38
Bala Pravin Avatar answered Oct 23 '22 04:10

Bala Pravin


After spending hours, this worked for my OnePlus5 on Ubuntu 16.04

  1. Enable the developer option and USB debugging in device
  2. Attach device to laptop
  3. Get 4 digit device id to add in udev rules. Look - https://reactnative.dev/docs/running-on-device
  4. Make sure below given line added in /etc/udev/rules.d/51-android.rules, 2a70 must be replaced by your device id SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev"
  5. sudo chmod a+r /etc/udev/rules.d/51-android.rules
  6. Change “USB used for” setting to MIDI in your device
  7. Run sudo adb kill-server && sudo adb start-server
  8. adb devices now showing my device
like image 22
Rakesh Shekhawat Avatar answered Oct 23 '22 04:10

Rakesh Shekhawat


Go to your device manager, right click the phone and click update driver. There should be an option to select the driver from a list. Find Universal ADB Device on the list and select that.

like image 27
Sumit Kukreja Avatar answered Oct 23 '22 04:10

Sumit Kukreja