My Galaxy S9 device keeps appearing as "Offline" when I try to debug. It was working with the same application previously, and nothing changed. I receive this error: Session 'app': Error Installing APK
and
com.android.ddmlib.AdbCommandRejectedException: device offline
Error while Installing APK
Things I've tried:
I updated Android studio
All combinations of cleaning/rebuilding my project
Rebuilding APK
Double checking that I have the most up to date drive on my pc
Emulating didn't work either, but I was able to fix that by installing the Intel HAXM installer. Is there another set of developer tools I need to debug on hardware?
just today I've been through a similar situation with my MOTO G5: Everything was working just fine a few weeks ago and somehow it stopped working (maybe some windows update messed with something), device was always "offline" when using "adb devices". I've tried lots of different suggestions (reinstall drivers, disable/enable usb debug, adb kill/restart-server, change cable, change USB port, restart PC, restart phone, just revoke usb auth (see below) with no success.
Then I realized: what if I delete the RSA keys, and just then revoke the USB debug authorization? And finally, it worked!
Thanks to this website I've quickly found the location of the keys: Refresh Android Debug Bridge Keys.
On Windows, they are on folder C:\Users\{username}\.android\
After that, next time I plugged the phone and performed a "adb devices" finally, it showed "unauthorized" instead of "offline". Then on the phone screen there was a popup requesting authorization. Once authorized again, voila: everything working!
Since I didn't find this suggestion on any other forum before, I decided to post here my personal solution. Maybe I could help some other fellows with same issue.
Disable and re-enable adb debugging in your device's Developer options. Also, when you connect the device to your computer, you will get a prompt in the device asking if you want to trust the computer, Click ok.
try adb kill-server && adb start-server && adb devices
besides, this is no emulation, but debug on physical hardware.
one could also define this script as "external tool" in Android Studio.
This may be a late answer, but this is what worked for me.
When prompted on the computer to choose what happens when the device is plugged in, choose "Do Nothing" or simply ignore it.
On the Device, When asked "Allow Access to phone data?" tap AllOW.
This is what you should see when you swipe down from top.
In the options above, select charge this phone
wait for a few seconds and then again select either Transfer Files or Connect a MIDI Device
The device should show up in your list after some time.
If it doesn't, disable and then re-enable USB debugging from the developer options.
Related
I am using LG Optimus G. ADT shows that my device is offline and version is unknown as seen on the screenshot. I am sharing my device manager look also. It is installed but i think it is not properly working. I don't want to ignore that matter it is probably going to face me later.
Thanks.
1. First ensure that the device is set up properly for USB debugging. Check that
- you have installed the proper driver for your phone on your PC.
- you have enabled USB debugging in Developer Settings.
2. After you have done the first step, when you connect your phone to the PC, a dialog will popup on your phone prompting you to accept the computer's RSA key. Accept it and the device will be shown as online in your IDE.
3. As a last resort, you can try re-starting your IDE. This will force adb to start properly.
I was doing the Android tutorial on the Google website and I was at the point where you want to run your fantastic Hello World application on your phone. When I run my application from Eclipse, I see that my phone status is ?? and the target is unknown. When running adb devices in cmd, it says that my phone is unauthorized. It appears that it has something to do with the RSA fingerprint prompt. I don't remember ever getting such a prompt. Yes, I am running in PTP mode and debugging is enabled. I tried, after looking around on internet for multiple hours:
-Enabling/disabling debugging mode repeatedly
-Uninstalling and reinstalling my drivers for my phone or ADB
-adb-killserver and adb-startserver
-Restarting my phone and unplugging/replugging in multiple ways
I did notice that in my (user)/.android/ folder, I don't have a file called adbkey.pub (which is apparently the file that's supposed to have my key). Anyway, I don't think I've ever received the prompt about RSA fingerprint and I can't make it appear in any way.
Do you guys have any idea what I could do at this point. I tried about everything on these forums and around on the Internet but maybe there is something else I could do. Should I reset my phone to factory settings at this point to make the prompt appear again?
Make sure your android SDK is up to date (I think we're on v22.xx of the tools). Older versions fail in the manner you describe when hooked up to Android 4.2+ devices.
Do you have MTP transfer mode on? I just had this problem, solved by restarting the adb server and then disabled MTP on the phone at which point it immediately prompted for the RSA fingerprint and connected.
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.
As title, I can't able to find my phone device into Eclipse.
I activated on the my phone, either Application/Unknown Source and Application/Development/Debug USB.
But into Eclipse not appear any device phone, why?
Thanks'
Go to the cmd prompt, and then take it to the platform-tools.
Then type the commands
adb kill-server
and then
adb start-server
Then to list the connected devices,
adb devices
you will see the list of active devices including the emulator. If the device is not present, continue the steps for some time..
After you get the device listed among the active ones, you can run it in debug mode.
Think, this will help you..! :)
I just had the same problem on 2 of my phones (Nexus 1 and Amaze 4G). After some research I found that people try to overcome this by restarting Eclipse and ADB (only Eclipse won't do) but it took me rebooting the system and phone to make it work again. If you can go to Eclipse->Window->Open Perspective->DDMS and see if your phone shows there with red bug icon next to your app. If so then try what I described above. If you don't see your device in DDMS perspective then it's your USB driver that is not working and needs to be reinstalled
Had a similar problem with my LG P520. In my case, the problem was as a result of me setting the minimum Android level to Android 2.3(9) while the phone was a Froyo/Android 2.2(8) phone. Hence, it was not a compatible device and would hence not be shown in list of compatible devices.
connect your PC with internet may be it will install some software to connect it with the phone debugger and make sure you enable the usb debugging on your phone.
I am trying to enable USB Debugging on Android so that I don't need to use the emulator.
I did what all the posts all around the web say to do: I went to settings -> applications -> Developer -> USB debugging
It still does not turn on the notification sign that USB Debugging is enabled, and Eclipse does not recognize it, and uses the regular emulator.
Does anyone have any idea what is wrong?
You haven't specified what device you are using or what operating system you are using, so that could be helpful.
A few things to keep in mind:
1 Don't mount as USB storage.
2 You also need to make sure to install the drivers for your phone so that the Android Debug Bridge (ADB) can properly communicate. After these are installed, try the command "adb devices" and you should see an item in your list of devices.
Update based on your comment: You can download Kies from Samsung, which include the drivers (as well as other things): http://www.samsung.com/us/kies/
Or you can find unofficial driver-only packages, such as: http://forum.xda-developers.com/showthread.php?t=961956
I think you'll need the OEM USB dirvers.
Read this:
OEM USB Drivers
My experience with windows has been that you might need to un-install the USB drivers under device manager. Then disconnect the device (restart might be required). After plugging the device back in make sure you use the manufactures drivers if available
you have installed your device driver rite?then right click on your app name->run as->run configurations->target->select manual->apply.after that click on debug button then it will ask you to select the device.
If everything else is tested, try with another USB cable.
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.
Fruthermore on some devices you will be asked to accept an RSA key, which allows debugging through your computer. This ensures that other adb commands cannot be executed unless you're able to unlock your device.
Detailed information can be found here:
http://developer.android.com/tools/help/adb.html It is the overview about adb commands (which is used to send data to your device) and it starts with the steps how to bring your phone to debug-mode.
I wish to add to Danation's answer with the following.
If you have installed KIES, and you've tried following instructions a couple of times (for the android SDK package) without success, here's what worked for me:
As a precaution, disconnect the device, and press 'Revoke USB Debugging authorizations'.
Now, go to kies, and reinstall the device driver as seen on the image below.
Connect the device.
For me, it was a routine, it usually works when installing kies, but I was stuck on this today for a little while, and I hope i can help others with my solution as well..