There's absolutely heaps of these questions out there, all with a seemingly random assembly of answers that don't really talk about why, and don't offer anything that at least covers ALL of the reasonable approaches.
I'm running ADB on OSX, but I've got other team members using Linux (Ubuntu) and I occasionally use Windows. OS doesn't really seem to matter, so long as the relevant USB driver has been installed on Windows.
I've got a heap of different makes and models of phone that I'm swapping in and out. Sometimes a phone that previously worked stops being recognised by adb devices. So not really specific to a particular phone.
I've got a USB cable that I know works, for several makes/models of phone.
But still, when I get a new phone to try I still have to faff around with it to get it working.
What I'm after is a checklist of sorts, that results in a reasonable chance of success in getting adb devices to work.
So here's what I've found:
Hardware:
Good USB cable - if it works for one phone it will probably
work for others. If it consistently stops working, throw it away and
get another.
Phone/Tablet/Device - Pre-requisites:
Make sure the phone is charged up - at least 30% seems to be a common
minimum.
Get all system updates and app updates done.
Enable Developer Mode. Settings->About phone->Build number - tap 7 times
Computer - the 'turn it off and on again' approach:
This is useful to know, but doesn't generally get things working. It goes like this:
adb kill-server
adb start-server
adb devices
If you don't see your device after adb devices then the above isn't the answer (but it's still good to know).
Phone/Tablet/Device - the 'wipe it and start again' approach:
This is basically clear your current settings and then re-establish them.
In Developer options, under Debugging:
Turn OFF USB debugging (some phones won't let you click this option - thanks LG)
Click/Tap Revoke USB debugging authorizations
Turn ON USB debugging, answer OK to the first dialog
And if you device is already plugged in:
WAIT, for a second prompt asking if you want 'Allow USB debugging' and click 'OK' - not every device will trigger this second prompt straight away, but give it 5 to 10 seconds just in case.
Now, get permission for EVERY use of the USB connection.
Swipe down from the top and tap on the item for USB connection.
Systematically work through every option your device provides and grant permission when asked. Don't do just one option, do ALL of them, including Charge phone.
Having given permission for one of the usages of the USB connection some devices will give permission for everything - but most won't. For the majority you should go through each one and give the permission. Just to add to the confusion some devices will require you to revisit an option a second time before they give you the prompt asking for permission (thanks again LG).
Now try adb devices again. Still nothing? Go back through the USB usage options again from start to finish (I kid you not).
You may still need to reboot the device and/or swap between media transfer and photo transfer to get it showing up on adb devices.
So what if a previously working device stops working? Go through the 'wipe it and start again' approach first. It's likely to be the most effective. but I'd definitely check whether its time to retire the USB cable as well.
Related
I use an Android phone to do some basic Bluetooth compatibility testing in a remote testing environment.
In order to automate the test phone with Appium or view it's interface using Vysor, I have to allow a "USB Debugging" pop-up. This pop up gives the option to "Always Allow Connections from this PC" which I select each time. However, this authorization seems to reset after some period of time and I can't figure out why.
Multiple users access the phone from their own user accounts, and USB Debugging has to be authorized for each of these users individually, but whenever the authorization resets, it resets for all users and all users must be individually re-authorized.
These resets tend to happen on average about once per month.
My first thought was the phone must be updating, but Automatic Security Updates are disabled on the test phone, so I don't think that is the issue.
The last time I had to re-authorize USB Debugging, I noticed this pop-up on windows which occurred suspiciously the day before I had to re-authorize, but I don't know what caused this.
Does anyone know what might be causing these resets? Given how our testing is remote, it can be a major inconvenience to re-authorize the phone since the resets occur unpredictably.
Our research lab has several pair of Google Glass that we've been using in our research. Recently, one pair (that had been sitting in storage) stopped working - we booted them up about a month ago (they hadn't been used since April 2014) and during the boot sequence, we received several "stopped unexpectedly" errors (for Home, Camera, and Voice functions).
We spoke with Google twice on the issue, and they told us:
(1) The Glass likely lost a connection during a software update, so to do a factory reset we'd need the original device that the Glass were tethered to to initiate a factory reset. Sadly, we no longer have this device, so we cannot initiate a factory reset.
(2) The Glass are out of warranty, so they will not offer any further customer service, other than to direct us to StackOverflow. (stings a bit, to be honest)
So, my question ... there has to be a way to manually reset the Glass via USB? Any help or advice from this community would be incredibly helpful!
You can do factory reset in Google Glass by doing this:
Tap the touchpad to activate Glass.
From the Home screen, swipe backward on the touchpad until you see the Settings bundle.
Tap into the Setting bundle and swipe forward until you see the Device Info card.
Tap again and swipe forward until you see Factory Reset.
Another method can be done using Recovery Mode.
To access Recovery Mode, turn off Glass. Hold the camera button, then press the power button once. Continue to hold the camera button for about 10 seconds, and Glass will go into Recovery Mode.
In Recovery Mode, you have the option to:
Reboot normally
Reboot into fast boot (This is mainly used by developers)
Factory reset (Removes your account, pictures, videos, and Glass settings from this device. If your Glass is having issues, this will give you a fresh start. Warning: If your pictures and videos haven’t been synced to Auto Backup, they will be erased. If you want to keep them, connect Glass to your computer using the USB cable and manually transfer the files.)
Sideline from adb (Also for developers)
Check also this thread for more information.
I had a similar issue with 2 pairs I have. I contacted Google support on this and they told me to power them on and leave them close to the last known WiFi access point they were connected to.
This has worked for 1 pair. The other pair still has the same issues. I'll update if I find anything that worked.
Good luck
I have a similar problem. Unfortunately, same boat ... device is out of warranty and turning the device on and update itself using the original Wifi or the paired phone is non-existent. Also seeking any way to refresh the "image" of the OS/program on the device via USB.
I am working on a project where I need to put a USB device in to a reprogramming state and then send a software update to the device. I have been able to make this work by having the user disconnect and reconnect the USB cable between the android device and the USB device I am reprogramming. I have attempted many combinations of releasing interface and then trying to loop through the USBManager getDeviceList and then requestPermission on that device again. I have tried modifying the PendingIntent to be different than the original PendingIntent. I thought I had it once but it seems to have been a faulty OTG cable. In a last ditch effort I tried to craft my own android.hardware.usb.action.USB_DEVICE_ATTACH/DETACH message (which I got a Permission Denial on) Any other ideas out there or is it just not possible?
I recently locked my phone (Samsung Galaxy S2) and I cut my WiFi and data off before it became locked. There for I can not log in to my google account. Can someone help me find a easy way to unlock it without factory reset or just find a way to cut my WiFi or data on? I have tried pressing the home button a amount of times and calling my self and pulling down the notification bar or pressing the back button but none of these options work.
If you USB debugging mode is 'on', you can try unlocking it via adb shell. I found this guide on googling:
http://maxoberberger.net/blog/2013/08/unlock-android-device-using-adb/
None of the options like adb or entering null password or calling worked for my Galaxy Y. But I found this software to backup phone data like contacts,memos,schedules,etc to my pc.
http://www.samsung.com/us/kies/
Since factory reset doesnt affect your sd card, you can later transfer the backup from pc to your phone.
I am new to Android SDK. Maybe someone here can show me how to debug the following problem I have with my Android enabling and keeping the wifi switched on.
I have myself a Samsung Galaxy ACE s5830 which I got just few days back and had found this problem where the phone just displayed error while switching on wifi. I then restarted the phone and found that wifi was working fine. After this I began noticing that the phone occasionally (two or three times a day) got hung up with a blank screen while the keypad is locked (while charging and while idle). When I tried unlocking the keypad, the phone do not respond. I would then have to disconnect the battery or press and hold the power key for 10 seconds to bring my phone back to life. However, I can see that if I switch off wifi, the phone does not get hung up.
I have installed SDK and Dalvik Debug Monitor in my PC but I would like to know how I will be able to debug this issue with the phone connected. Thanks in advance.
If I understand correctly, this issue occurs when you are on a charger with wifi active and the device goes to sleep.
You might attempt to understand the issue by connecting the phone to your computer via usb and leaving "adb logcat" or its DDMS-window equivalent running, and see if anything interesting is shown if it dies. But you may just get buried in extraneous messages until you have some real familiarity with what is normal (lots of weird errors/warnings all the time) and what isn't. After a restart you can look at things like /proc/last_kmsg
Incidentally, if the problem happens on the mains charger but not when connected to the pc (just connected, SD card not mounted and DDMS not running), that could suggest the culprit is electrical noise from the charger.
Or you could attempt to work around it. Some devices have in their settings menu an option to stay "on" whenever connected to a charger.
I believe that you could also write an application which listens for ACTION_BATTERY_CHANGED intents, detects that you have gone on the charger, finds out if wifi is on, and if it is acquires a wakelock. You'd also look for going off the charger or disabling wifi, at which point you would release the wakelock.