Android Studio - Device is connected but 'offline'
This is quite a common question, but none of the solutions appear to work for me. First time asker, so apologies if I get the conventions wrong.
I am trying to connect my Galaxy S5 to my computer running Ubuntu 14.04 so I can do some android development. I have recently downloaded and installed Android Studio and the SDK and my device is detected when it's connected via USB but the device either appears as 'unauthorized' or 'offline'. I know I should be expecting the RSA key prompt but this never appears.
I have tried:
- Checking debugging was enabled
- Running adb kill-server and adb devices
- Restarting (the device, developer options, the machine)
- Simple unplugging and replugging the USB cable
- Checking my adb version (it is 1.0.31)
- Trying different USB ports
- Revoking USB debugging authorizations
- Toggling enabling ADB Integration from within Android Studio
- Connecting as PTP device and MTP device
I have tried it on a separate machine that runs fedora and this works fine with no issues, the promopt appears right away. Therefore I imagine it is not the USB cable that is faulty.
Any ideas?
Try these:
- Unplug and replug the USB cable.
- If it still doesn't work, unplug the USB cable, disable then enable USB debugging in the device settings.
- If the above two methods fail, reboot the device.
- If rebooting the device also fails, reboot Android Studio too.
- If reboot Android Studio still fail, try
adb kill-server
thenadb start-server
Hope this helps.
Try killing adb adb kill-server
then disable usb debugging and then start adb by adb start-server
then enable usb debugging and plug phone again and huh don't let phone sleep between process
EDIT
There turned out to be a problem with my laptop's ADB RSA key. I'm assuming my G3 was rejecting a bad key and disallowing my laptop to connect to it via ADB.
ADB saves a key file in one of multiple places on a Windows computer, the first is in the location where adb.exe is (C:\android), the second is in the user's >profile (C:\Users*username*.android), the third place is in the Windows system files (C:\Windows\System32\config\systemprofile.android), the file is >simply named "adbkey" with no extension. If there is no key file when ADB runs, it will generate one automatically.
Mine was located in my user folder (C:\Users*username*.android). All I had to do was delete the adbkey file (there was also a file named "adbkey.pub" which >I deleted as well), restart the adb server in command prompt (adb start-server) and plug my phone in. I instantly received the RSA Fingerprint Key window on my >G3 allowing connection between the two devices. Then typing "adb devices" returned my phone's serial number followed by "device" showing it was available. >I went back to the C:\Users*username*.android\ folder and sure enought there were new "adbkey" and "adbkey.pub" files.
got from XDA
EDIT 2
TRY this steps too
- Navigate to where .android is stored
- open .android and delete file named as adbkey and adbkey.pub
- Start ADB then type
adb kill-server
andadb start-server