USB Debugging: How to revoke the "Always allow from this computer" option - android

I've started developing for android. I'm using different computers with different operating systems. (A Windows desktop PC and a Macintosh at home and a Windows Notebook at work)
Most of the time I am using my desktop pc for development but since yesterday my Nexus 4 is displayed as offline in the Eclipse ADT Devices view. This problem only occurs on my desktop pc. On the other computers I don't have any problems getting the device online in eclipse.
I already tried a lot of things like:
- unplugging/plugging the nexus 4
- switching off/on usb debugging
- restarting computer, nexus 4 and the adb server
- reinstalling nexus 4 usb drivers (I'm using the Android Composite ADB Interface Drivers from the Android SDK)
I was about to give up but then I remembered something. After connecting the nexus via usb the "Allow USB debugging" dialog shows up and on my desktop pc I checked the "Always allow from this computer" option.
My hope is that disabling this "Always Allow"-permission could help to get my device back online. I already searched in the developer options to find a way to reset the "Always Allow" permission without success. Maybe it is possible to reset the permission by clearing the data of the App/Service (Settings->Apps(All)) which stores this information but I didn't find the name of it in Google.
So does anyone know the name of the App/Service whose data has to be cleared to reset the permission? Or is there another way to get the device back online that I have not tought of?

You can use your device with multiple computers with that enabled as well. I can use my Nexus 7 and Galaxy Nexus, both running 4.2.2 and having checked the always allow option on 3 machines right now.
Make sure all your machines are running the latest update for ADT and the SDK Tools, as the adb in the previous versions does not support the 4.2.2 security measures. One of my machines had the same problem, and it got fixed when I updated my tools.
Also, sometimes you have multiple Eclipse installs (I have about 11, for various reasons). If all of them aren't updated with the latest tools, make sure your PATH points to the adb in the newest update, and not any other.

Related

Pixel 2 XL will not connect to PC for Android Studio Debugging

I am trying to create a React-Native app and I need to connect my device to troubleshoot some issues that only occur on the physical device and not the simulator. For some reason I have never been able to connect my Pixel 2 XL to my PC. I am running Windows 10 and I have tried all of the following.
Enabling developer mode and USB Debugging on my device.
Uplugging and replugging my device 20+ times in a row.
Changing the USB port I am using.
Changing the USB connectivity settings in Developer Options > Default USB Configuration. (Options are: File Transfer, USB tethering, MIDI, PTP, No data transfer) I've tried them all.
Restarting my device while it's plugged in
Downloading the Google USB Driver (in Android Studio).
Restarting my PC when the device is plugged in.
Updating my PC, and updating my device.
Checking Device Manager and trying to update the driver. (So the device used to show up with the yellow warning triangle next to it and trying to update the driver never worked. But now, the device doesn't even show up in Device Manager anymore)
Factory Reset my phone.
Downloaded Media Feature Pack for N and KN versions of Windows 10 (Suggested by the google tech support)(I called them)
I feel like I've tried everything previously addressed in every Stack Overflow question on this issue.
Finally solved the issue. The data cable was the problem. If you have tried all the steps above, and nothing is working, buy a new cable. This one works great and seems very durable for my Pixel 2 X: https://www.amazon.com/gp/product/B01N4OKUB8/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
I had this issue too - my Google Pixel 2 XL is about 9 months old. Was developing an app, so using USB debugging to debug the app as I built it. One day it mysteriously stopped working, though no issues with charging. I tried everything, including using all the different USB ports on my laptop, with no luck.
I eventually gave up and started using the emulator on Android Studio, and since I didn't need data transfer for anything else, I didn't send my phone for repair or anything.
A few weeks later it just started working again, all by itself...
I don't think I did anything to fix it - the moral of the story is, if you don't need it urgently, there's a chance it might just decide to work again!

Android Studio no longer recognizes LG G Stylo

I need to know how to make Windows 7 forget it ever connected to my LG G Stylo phone. I have three devices that I use in Android Studio development. For some reason, this one is no longer being detected by the ADB. Something has happened to make it no longer show up, because it did a couple of weeks ago.
AS's ADB will detect my other two devices, and this device shows up in the in the ADB on another computer. I have tediously gone through the registry and removed everything referencing the Stylo, but it still will not show up in AS's ADB.
Thanks for the help!
John
To start, I have just purchased the LG Stylo 3 plus and ran right into this situation. TO repeat the basics you need
With Android Studio shut down...
Turn on Developer options (tap 7 times on build number in settings
(Settings>System>About Phone>Build Number
Turn on USB Debugging in Developer Options
(optionally) check on the type of USB connection, MTP or PTP should
work
(Optionally) Because I did it, also do a revoke USB tap.
Here was the key for me. I needed to install the LG USB Windows Drivers for my Windows 7 (I'll try 10 tonight and update). Go to this page
LG Drivers and firmware
and either type in model number or browse to find device. LG has a nice interface to install the Windows Drivers. I recommend the Support tool to verify the device as the up to date drivers as well. Start Android Studio and to test I just started the app in debug mode and went through the process of setting up ADB for using the new;y connected device.
Developer options" has to be ON in order to make AS see the device
If even though device manager you can't saw the device, Windows couldn't find drivers.Maybe the drivers are hidden on the device otherwise download it and install it.
If that doesn't work:
Shut down
Hit F8 (or whatever gets to startup options screen on your computer)
Disable Driver Signature Enforcement.
Run driver

Android Studio doesn't list my phone in the device manager

I've been working on the HelloWorld app for a few weeks now, overcoming many little hurdles, and I think I've reached the last one. I'm working out of 'Learn Android Studio' by Adam Gerber (not an endorsement, just happens to be the book I'm using). I have an HTC One.
When I open the device manager, there is no device listed. In the terminal, I issue the command adb devices and I get the heading "List of attached devices" with nothing listed. If I click the green run arrow, I'm asked to choose my device, but my device isn't shown.
I used to get the error "Unable to obtain result of 'adb version'" when I opened the device manager, but I don't get that anymore, for some reason. But now, when I open Android Studio, I get a Windows Firewall window telling me that some aspects of Android Studio are blocked, including public networks. I don't know if this is the reason for my difficulty or not (I don't think connecting my phone to my laptop is like a public network, is it?).
I went to the developer.android site and followed the directions for connecting a device:
How to connect an Android device to Android Studio.
Step 1 is: "Verify that your application is "debuggable" in your manifest or build.gradle file." The details on how to do it are provided, and I made the appropriate addition to my build.gradle file.
Step 2 is: "Enable USB debugging on your device." This is the thing where you tap your phone at a certain place in the settings to enable development capabilities. I did that.
Step 3 is: "When plugged in over USB, you can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you'll see the device name listed as a 'device.'" As I mentioned above, I get a heading for a list, and no items listed. My book says on page 23: "If your computer does not recognize your Android device when you connect to your computer via a USB cable, you probably require a USB driver. If your computer initially recognizes your Android device, you should probably forgo installing a different or newer version of the USB driver, as this could cause the USB connection to fail." Since I've transferred image and music files to and from my HTC One dozens of times, I followed this advice and did not install a driver (Actually, before I read this book, I had started looking for a driver, following the links on the developer.android site, but I wasn't able to locate one).
On another site where programmers congregate, someone gave me this list of 4 items to check:
- Have you reinstalled adb? (I'm not sure what this means.)
- Do you have the DeveloperOptions SubMenu enabled on your phone? (yes)
- Do you have USB debugging enabled on your phone? (yes)
- Do you have AllowMock Locations enabled on your phone? (I did not, and I enabled it.)
Regarding the first item, my adb is an exe. How do I 'reinstall' that? I responded to his message, and he has not responded to clarify what he means.
Regarding mock locations, that was not enabled, and I enabled it and tried again to connect my phone to Android Studio. That's when the Windows Firewall window showed up for the first time. I don't know if it's because I enabled mock locations or not.
I also tried rebooting after starting the adb, as suggested by my book, on page 25, but that didn't do anything. "If after restarting the ADB server you still don't see the device, it's possible, though unlikely, that the USB driver requires a system reboot to take effect." I've noticed that adb starts up when I boot up (I tend to keep the task manager open), so I know my problem is not that the adb is not running.
I looked at many similar questions on this forum, and the most common advice seems to be to install a driver. Since my book says a driver might not be necessary and could ruin my USB connecting ability, and also since some programmers stated that their Android Studio connection to their phone was failing in spite of installing drivers, I'm not rushing to install a driver, especially since I need USB connectivity on my phone for my job.
So this is where I am. So, what about this statement in my book that if my laptop can see my phone, I don't need a driver. Would that be true? What else could be the problem?
Any help/suggestions/comments gratefully appreciated.
The fact that your computer can see your phone does not mean that you don't need a driver.
What that means is that your computer has the appropriate drivers installed for recognizing your phone as a media device.
What you need is for your phone to be recognized as an ADB device. These are often different drivers from the phone drivers that are installed by default, as the vast majority of users do not need to use developer tools with their phone.
If you can find these drivers from HTC, then they are very safe to install and the risk to your computer is negligible. Google's USB drivers installed via the SDK manager work for many devices and are also safe, though I cannot speak as to whether they will work with the HTC One or not.

Eclipse does not see my Toshiba Folio 100 Android 2.2 tablet

After a) growing tired of the slowness of the emulator and b) nearing the end of the development of my first android app, I decided to connect my old and forgotten Toshiba Folio 100 android 2.2 tablet to my Windows 7 development PC, in order to deploy my android app. The PC and tablet 'see' each other, that is, the PC sees the tablet as a disk drive. In the android settings I switched on the developer mode. I read through the many advice threads of this site concerning deploying the app to a real device. To start with, in windows explorer, computer, right click, manage, does not result in recognition of the tablet, except for Toshiba storage USB device.
In Eclipse I went to Run configurations, target tab,tried all the different radio buttons settings, to no avail. The devices view, same story. Eclipse does not see the tablet. I also tried some old Archos 48 mini tablet, again nothing.
What can I do?
Thanks in advance.
do you see it as an android device? open a command prompt and type "adb devices" make sure your tablet is listed there, otherwise you need to find some adb drivers for it, you may want to try the generic adb usb driver.
If you're seeing the device in explorer listed as a disk drive it probably means you have the wrong USB mode on the device. It's called different things on different devices, but on many devices it's referred to as "Charge Only" mode (or not mass storage mode). Also make sure USB debugging is enabled on the device.

After upgrade Android on Nexus to 4.2.2, Eclipse shows target unknown for device?

I just upgraded my phone to 4.2.2, but now i cannot use it in eclipse anymore.
I tried rebooting the device, reset my debug-settings but I cannot get it to work anymore.
I saw it is already a registered issue. There are some new security enhancements, so there should be a dialog (see here at bottom) but this dialog doesn't appear. I don't have several accounts on the phone, which is pointed out in the issue..
Anyone any suggestions?
EDIT: Look at accepted answer below, this should cover all cases. In my case, there were some packages missing, which weren't shown in the Android SDK Manager. I just found the Packages -> Reload in the Android SDK Manager... And I thought this happens automatically
You need three things in order to make sure this update goes smoothly:
Make sure your device is actually running 4.2.2 and the problem is not something else
Your SDK is updated to the latest tools. The adb binary in all but the latest version does not support the 4.2.2 security enhancements.
You are on the main account of your device in case of multiple user accounts.
Connect your Device to your computer and execute adb devices (make sure USB debugging is enabled). You should see something like this:
3tiu52839ry082j3 offline
Right about now, there should be a dialog on your device that looks something like:
Check the Always allow from this computer box if you want and click OK.
That's about it.
Some other things to check:
Make sure your USB cable isn't broken. Sometimes, the smaller cables break inside the main one, and your device may charge but have no data connection. Try with a different cable, or try accessing files on the device over USB (this will go fine if your cable is fine)
Make sure you're using the newest version of adb. Even after I updated my SDK tools, I couldn't get my device authorized when using adb. I eventually figured out that the Nvidia install of the NDK and SDK tools had updated my PATH variable to use the adb from that install, which wasn't the latest update. By using the adb in my newly updated install, I was able to get it all working.
For me it was solved by changing Nexus 7 tablet to "Camera(PTP)" mode.
Check out this blog post on how to do it.
After USB connection of Nexus 7 and confirming digest on Nexus 7, also connecting through TCP/IP with ADB worked.
Wierdly, unchecking and rechecking the "Allow USB Debugging" option popped me the window and selecting "ok" solved my problem.
If none of the solutions worked for you then Reset ADB.
Go to Devices ---Click the right most down arrow----Select Reset ADB from the list.
I had tried everything suggested here and suggested in every log/blog that I could find in google, but still no go. The USB cable is known to be good. ADB is version 1.0.31 (as shown with , USB Debugging is enabled in the Nexus 7 tablet, the SDK was updated to the very latest tools as available on 1-mar-2013 for 4.2.2/API 17. I had tried both Media and Camera modes for USB, rebooted windows, rebooted device over and over again, re-installed latest google USB driver, etc. etc. but ADB Devices still showed nothing.
I hard reset the Nexus 7 tablet thinking that maybe the screen to allow usb debugging had appeared but got hit with cancel. But that didn't work either.
What finally worked was:
going into windows control panel | Device Manager,
selecting NEXUS under Portable devices,
then in the Driver tab clicking on update and manually selecting the Google USB driver (the check feature said it was up to date). Previously, the date shown was in 2006, afterwards a date in 2012 (but more on this in a moment).
That didn't fix anything though.
So then I switched USB from MEDIA device to Camera device - THEN it wanted to install driver software, so I let it do that. Afterwards, I noticed that the driver for the Nexus was back with the 2006 version, BUT then ADB DEVICES FINALLY SHOWED OFFLINE!!!! HALLELUJAH AND the Nexus was displaying the Dialog to allow USB debugging, and it now all works.
What I am not sure of is what step actually solved the problem. I don't think it was necessary to hard reset the Tablet, but the fiddling with the device driver wasn't a very convincing solution either - I don't think the driver was corrupt - but maybe it had to be changed to get the right driver associated with the tablet when connected as a Camera Device. In any event, it is necessary to connect the tablet as a Camera device for ADB to work...
Restarting device or enabling USB debugging did not solve my problem.
However I changed USB PC Connection to "Camera(PTP)" mode and adb devices showed the device id of the phone.
After reading a lot post talking about this particular problem, I actually solved it by resetting user permissions on files (that were owned by root): ${HOME}/.android/adbkey and ${HOME}/.android/adbkey.pub
Go to Device Manager and uninstall your device and remove from USB
HAve you CMD opend and make sure you are at least in ADB Help.
Connect device to USB and continue with steps provided by Raghav Sood - few answers ahead of me.
Worked for me just fine
I tried with this custom build and it works for me. Now I can see my logcat in Eclipse again.
https://github.com/khaledev/ADT/releases
Download the zip file then in Eclipse menu Help > Install New Software... > Add > Archive... Just pick the downloaded zip and do the rest of the install process.

Categories

Resources