[Q] USB Debugging - Checking - Java for Android App Development

Hi,
Does anyone know how to check if a computer is connected to your Android device over ADB. From the Android device of course.
Doesn't have to be a Java solution, but would be obviously preferred.
Many Thanks,
Minooch

Related

[Q] USB Connection

Hello all,
I have a small problem. When I connect my Asus Nexus 7 to PC, it does not do anything. But when i connect it with debugging on - everything is OK. Device manager shows only Android ADB interface with no other unknown devices. How can I fix that?
Thank you guys in advance!

Nexus 4 appears as unknown device

Hello, I am trying to connect my nexus 4 to my computer to put some music on. This used to work, but now it is being detected as an unknown device. I tried updating the drivers to the Universal Naked driver, but it just says the best driver is already installed. I tried with USB debugging on and off, no difference. Also tried 2 different usb cables.
Cyanogenmod Version: 10.1.1-mako
Build: JDQ39E
Thank you for any help!
jining said:
Hello, I am trying to connect my nexus 4 to my computer to put some music on. This used to work, but now it is being detected as an unknown device. I tried updating the drivers to the Universal Naked driver, but it just says the best driver is already installed. I tried with USB debugging on and off, no difference. Also tried 2 different usb cables.
Cyanogenmod Version: 10.1.1-mako
Build: JDQ39E
Thank you for any help!
Click to expand...
Click to collapse
What OS are you using? Windows? Mac? A linux distro?
Also, are you sure you're using MTP instead of PTP (Settings > Storage > menu > Usb Computer Connection) ?
You can try to install google's drivers from the android sdk as well.
vorbatello said:
What OS are you using? Windows? Mac? A linux distro?
Also, are you sure you're using MTP instead of PTP (Settings > Storage > menu > Usb Computer Connection) ?
You can try to install google's drivers from the android sdk as well.
Click to expand...
Click to collapse
I am using Windows 7, it was set to PTP, I just set to MTP, but it still does the same thing. I have turned off my USB debugging in the developer menu as well.
jining said:
I am using Windows 7, it was set to PTP, I just set to MTP, but it still does the same thing. I have turned off my USB debugging in the developer menu as well.
Click to expand...
Click to collapse
I know this is a silly thing to ask, but have you tried rebooting your phone? Something like this happened to me before and a reboot fixed it.
Also, if you have a custom kernel, check that you have USB fast charge disabled. And after that fails, try installing google's drivers. Sorry, I'm just spouting out random ideas at this point.
vorbatello said:
I know this is a silly thing to ask, but have you tried rebooting your phone? Something like this happened to me before and a reboot fixed it.
Also, if you have a custom kernel, check that you have USB fast charge disabled. And after that fails, try installing google's drivers. Sorry, I'm just spouting out random ideas at this point.
Click to expand...
Click to collapse
Thanks for the suggestions. I am using Franco kernel, how do I turn off fast charge?
jining said:
Thanks for the suggestions. I am using Franco kernel, how do I turn off fast charge?
Click to expand...
Click to collapse
Use trickster mod and go to the Kernel Specific page. If fast charge is ticked off, there's not much we can do from there.
https://play.google.com/store/apps/details?id=com.bigeyes0x0.trickstermod&hl=en
Also, have you tried to install google's drivers or make a nandroid and reflash a clean rom?
EDIT: You could also try Koush's universal driver: https://plus.google.com/103583939320326217147/posts/BQ5iYJEaaEH
I'm afraid I'm out of ideas at this point
vorbatello said:
Use trickster mod and go to the Kernel Specific page. If fast charge is ticked off, there's not much we can do from there.
https://play.google.com/store/apps/details?id=com.bigeyes0x0.trickstermod&hl=en
Also, have you tried to install google's drivers or make a nandroid and reflash a clean rom?
EDIT: You could also try Koush's universal driver: https://plus.google.com/103583939320326217147/posts/BQ5iYJEaaEH
I'm afraid I'm out of ideas at this point
Click to expand...
Click to collapse
Hmm I am in the trickster mod on the kernel specific screen, but I don't see anything about USB fast charge Where might I get googles drivers? I can't seem to install any drivers because as soon as I uninstall the unknown device, it auto installs some drivers.
Thanks for the help!
jining said:
Hmm I am in the trickster mod on the kernel specific screen, but I don't see anything about USB fast charge Where might I get googles drivers? I can't seem to install any drivers because as soon as I uninstall the unknown device, it auto installs some drivers.
Thanks for the help!
Click to expand...
Click to collapse
So I tried installing the newest Franco kernel Milestone (3), and the USB fast charge is off. I also tried installing a different CM mod, but there is no difference. I also tried installing the universal you gave me, but that didn't work, and i installed the google driver from SDK and that didn't work.
I don't know what else to do...
Hi, try to completly unninstall ALL drivers for nexus, samsung or android related, than install official drivers for nexus 4 and then connect nexus 4. Should work.
maxiiik said:
Hi, try to completly unninstall ALL drivers for nexus, samsung or android related, than install official drivers for nexus 4 and then connect nexus 4. Should work.
Click to expand...
Click to collapse
I tried that, no luck...I don't know what else to do, I have tried 3 different cables. I tried using the drivers that come with the nexus 4 toolkit, but no luck. It charges when plugged in, but i get nothing else. Also it seems like half the time its not even in the device manager as an unrecognized device, and then it intermittently pops up a window saying unrecognized device detected... maybe my USB port is broken on the phone?
Is there something simple I have overlooked to get 4.2.2 to work with my computer?
jining said:
I tried that, no luck...I don't know what else to do, I have tried 3 different cables. I tried using the drivers that come with the nexus 4 toolkit, but no luck. It charges when plugged in, but i get nothing else. Also it seems like half the time its not even in the device manager as an unrecognized device, and then it intermittently pops up a window saying unrecognized device detected... maybe my USB port is broken on the phone?
Is there something simple I have overlooked to get 4.2.2 to work with my computer?
Click to expand...
Click to collapse
Have you managed to solve this? I'm facing almost the same problem!
No, I tried for hours with no luck. I am glad I am not the only one, hopefully a solution will come to us. I have been using airdroid to transfer files from my phone in the mean time.
Im also having the same issue except my computer only recognizes my phone when its connected as a camera.
Sent from my Nexus 4 using xda app-developers app
I am having a similar problem with my daughter's Nexus 4 phone, which is not rooted nor unlocked - it is still completely stock. It was just updated to Android 4.3, however I can't say that this is the cause of the problem because she never attempted to connect her phone to the desktop machine before.
I have a Windows 7 x64 box at home, and spent over two hours last night trying to get the computer to correctly recognize the Nexus 4 phone. I was hoping that the standard MTP Windows driver would handle it perfectly, but no luck. I tried the Google usb drivers, and the ADB interface was recognized, but still no access to the internal storage. I then gave the Naked Drivers a try, and no joy there either.
I am beginning to suspect that the MTP drivers on my desktop are munged, but do not relish the thought of a Win 7 wipe and reinstall.
Anyone else have any ideas?
Thanks much!
I am having a similar problem where I have USB storage set to MTP and Windows doesn't pick it up, whereas PTP Windows will pick up but I can't access any folders other than the camera related folders like DCIM.
So my workaround is doing it the old fashioned way through CMD in windows using adb push.
Example:
Assuming you have all the stuff you want to transfer in a folder called stuff, adb is located in C:\adb, and your folder known as stuff is also in C:\adb:
C:\adb>adb push stuff /data/media/0
The above command starting from the ">" will transfer all files in the folder called stuff to the root of /sdcard. In the N4, /sdcard is symbolically linked to /data/media/0.
Of course you need USB debugging enabled for this to work...
Device Manager (Hopefully this helps)
In the start menu type device manager, in that window you should see android and or something similar at the top. You want to drop the menu down and right click what should say Google ADB Interface and delete it, make sure you check the confirmation box. After reboot your computer! Once booted plug your phone in a viola!!!
I'm having a similar issue.
I can open device manager but there in no Android anything listed. All that comes up when I plug my phone in is 'unrecognized usb device'. I have 5 different cable I have tired. The OS will only bring up the usb error in a USB 3.0 port. It will not do anything if I use the 2.0 port.
I have gone and tried to manually update the drivers through the device manager but when I select the drivers from Android SKD or any of the other driver packs I get an error that it is not a x64 driver.
I found one suggestion about modding the driver to include the device but windows will not even recognize the device other than a unknown usb.
I'm going to have a bricked computer soon. Any help would be appreciated.
Roktgr said:
I'm having a similar issue.
I can open device manager but there in no Android anything listed. All that comes up when I plug my phone in is 'unrecognized usb device'. I have 5 different cable I have tired. The OS will only bring up the usb error in a USB 3.0 port. It will not do anything if I use the 2.0 port.
I have gone and tried to manually update the drivers through the device manager but when I select the drivers from Android SKD or any of the other driver packs I get an error that it is not a x64 driver.
I found one suggestion about modding the driver to include the device but windows will not even recognize the device other than a unknown usb.
I'm going to have a bricked computer soon. Any help would be appreciated.
Click to expand...
Click to collapse
First, Google universal naked drivers xda. Try those. If they don't work go into device manager and go to where it says let me choose drivers from my computer. Then look for the android composite adb interface.
If you're on win 8 you'll need to allow unsigned drivers. Google how to do that
Sent from my Nexus 5 using XDA Free mobile app
jd1639 said:
First, Google universal naked drivers xda. Try those. If they don't work go into device manager and go to where it says let me choose drivers from my computer. Then look for the android composite adb interface.
If you're on win 8 you'll need to allow unsigned drivers. Google how to do that
Sent from my Nexus 5 using XDA Free mobile app
Click to expand...
Click to collapse
Windows 7x64 on all machines. I am trying this on 2 work computers and getting the same result. I have 2 issues that I think are the root of the issue.
#1 is the phone doesn't do anything in USB debug mode. I keep seeing references to having to approve the computer connection but I haven't seen that yet. I have tired 9 usb ports. 6 on my main computer will not bring anything, not even the usb drive. 3 on the labtop will only bring up a 'unrecognized usb drive'.
#2 is the computer will not recognize the device in anything other than a 'unrecognized usb drive' (UUD). Everyone keeps mentioning the Android Composite ADB interface. It's not there, it doesn't show up or as an option. I can go into the device manager and find the UUD and try and update the driver via the manual method with a disk but it doesn't list any type of hardware that is related to Android or ADB.
Roktgr said:
Windows 7x64 on all machines. I am trying this on 2 work computers and getting the same result. I have 2 issues that I think are the root of the issue.
#1 is the phone doesn't do anything in USB debug mode. I keep seeing references to having to approve the computer connection but I haven't seen that yet. I have tired 9 usb ports. 6 on my main computer will not bring anything, not even the usb drive. 3 on the labtop will only bring up a 'unrecognized usb drive'.
Click to expand...
Click to collapse
Hello,
"#1 is the phone doesn't do anything in USB debug mode." This is normal!
How I experienced the USB debugging option is that, if turned ON:
1. The Nexus does not appear in my Windows env
2. BUT when in recovery mode, I can use the "adb" commands
If USB debugging turned OFF:
1. Then I CAN see the Nexus in my Windows env
2. BUT I cannot use the "adb" commands in recovery mode.
So you definitely need to have the USB debugging option turned off if you want to see your nexus in Windows, IMO
---------- Post added at 04:16 PM ---------- Previous post was at 04:02 PM ----------
Roktgr said:
Windows 7x64 on all machines. I am trying this on 2 work computers and getting the same result. I have 2 issues that I think are the root of the issue.
#2 is the computer will not recognize the device in anything other than a 'unrecognized usb drive' (UUD). Everyone keeps mentioning the Android Composite ADB interface. It's not there, it doesn't show up or as an option. I can go into the device manager and find the UUD and try and update the driver via the manual method with a disk but it doesn't list any type of hardware that is related to Android or ADB.
Click to expand...
Click to collapse
I think you really have an issue with the drivers. I would install the Google USB drivers. Maybe a bit heavy but then you can be sure that drivers are fine:
http://developer.android.com/sdk/win-usb.html

[Q] Debugging on mac

Hi, I try to use my G2 with Android Studio for development but for some reason ADB doesn't recognize the phone!
Obviously I read around the internet. I've downloaded latest drivers, enabled debugging mode on my device and only thing left is that I dont see the option to use internet (Ethernet) when I plug my device into USB port. This is the step where everyone saying that it works if you do that.
I have a Mac not a PC. On PC it works fine. Any Ideas?
Nvm, Reinstalling the driver did the trick. thanks

[Q] USB connection not detected by Linux OS

Hi.
I am trying to connect my Samsung S4 by USB to my laptop running Fedora 22. The phone charges, but there's no connection detected by my OS. The device does not appear in the list of usb connections('lsusb' listing), and there's no indications of connection events record('dmesg' listing). I'm pretty sure I've done all necessary step I'm aware of for it to work: USB debugging is enabled, the phone is on, I've installed the libmtp and android-tools packages. Still no connection shows up.
Is there a step I'm forgetting?
If there is a bug, what is it and how can I correct it(or get around it)?
The phone is running Android 4.4.4.
Thanks.

MTP and ADB on switch

Hi all,
so i have got android installed on my switch but cannot seem to get the usb to work at all for ADB and MTP.
the switch does not show anything when it is connected by usb and it does not appear in device manager or adb on the host machine.
i have enabled developer mode and debug over USB.
i have tried to connect to ADB via the network but this lead to the authentication failing
does anyone have any ideas of what could be the issue?
I looked at lsusb on my Linux machine and it shows as a USB serial device, so I looked at the serial terminal and it doesn't print anything, so I guess you won't get USB to work, but you might be able to get WiFi adb to work but I haven't
Laurin Neff said:
I looked at lsusb on my Linux machine and it shows as a USB serial device, so I looked at the serial terminal and it doesn't print anything, so I guess you won't get USB to work, but you might be able to get WiFi adb to work but I haven't
Click to expand...
Click to collapse
Thank you that is greatly important stuff to know.
The issues I am having with ADB over network is that it requires the device to be trusted which first needs to be done over USB.
It could be done using root but I can not seem to enable root on this version of Android.
Roy8765 said:
Thank you that is greatly important stuff to know.
The issues I am having with ADB over network is that it requires the device to be trusted which first needs to be done over USB.
It could be done using root but I can not seem to enable root on this version of Android.
Click to expand...
Click to collapse
Just flash magisk, it's what I did and now I have root.

Categories

Resources