问题
I am using the latest version of Android Studio(2.1.2) at the time of writing this post . The problem that I am experiencing is that the ADB instance used by Android Studio doesn't seem to be able to find my Galaxy Core Prime device (SM-G361F, stock Android version - 5.1.1). It can connect to an emulator just fine.
What I had tried (most of these multiple times):
- enabling/disabling developer options
- enabling/disabling USB debugging
- revoking USB debugging authorization
- changing MTP to PTP and vice versa (my device doesn't allow deselecting both options, one must be chosen)
- reinstalling the drivers
- powering on and off both the phone and the PC
- installing Samsung's Smart Switch software
- using different USB ports
- trying out different Android Studio versions (x86 and x64 with the latest respective JDKs)
This is what it looks like in Android Studio:
I had installed the official Samsung's USB drivers from here.
This is what the Device Manager is showing (Windows 7 64-bit SP1):
Afterwards, I've also tried installing the Universal USB drivers from here.
This is what firing up its installation of ADB looks like:
It has obviously successfully found the device.
My device also politely prompted me to allow the PC to connect to it using a generated RSA key which never happened with Android Studio.
The only thing I've not tried is installing Samsung's Kies software.
I really don't know what is the problem here.
Maybe I should just give up and instead use the emulator but it is a damn shame not to be able to debug on an actual physical device, if you ask me.
Thank you in advance.
回答1:
Android in general does not support all phones for a debug connection. I have a samsung s6 and for me that works. I don't know about the Core Prime though. However, in most cases(in my experience):
- The phone does not support the connection
- You did not install all the required files in terms of the android SDK you might have not gotten the latest update that supports more phones
- The OS is not supported - Mainly caused because Samsung and a lot of other brands insist on having their own updates. And some times they - on purpose or by accident - forget to support USB debugging for developers. My tablet did not support the USB debugging connection untill it reached android 6.
- The cable is a charge-only cable (yes, those exist for some reason). Try with a different cable
- You don't have the necessary drivers. Make sure they're installed
It might be circumstantial that your phone model does not support the connection for some reason, but it is really hard to tell. The only way to get proper help is to contact Samsung customer support, but in my experience it is just a waste of time. They don't know their own products. If you try with another device it might work.
回答2:
After some continued tinkering I managed to get Android Studio to recognize my device. All I did was adding the path to the ClockworkMod's ADB .exe to the PATH environment variable. That seems to have done the trick as Android Studio now allows me to run the application on my device even though it is still running its own instance of ADB (located in the platform-tools folder).
It might be completely unrelated but I'm not considering undoing the modification made to the environment variable.
Here is the proof:
来源:https://stackoverflow.com/questions/38170802/android-studio-not-showing-connected-physical-device