Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.android.ddmlib.AdbCommandRejectedException: device offline (Even when device is connected)

After update of Android Studio to 2.1.2 I've been getting the following error too many times when i make a change.

com.android.ddmlib.AdbCommandRejectedException: device offline

Error while Installing APK

The problem is device was never connected and is not offline

If i unplug and re-plug the device it starts working fine again. This never happened in the previous version of AS.

Question: Is there a setting to be changed in AS for this to stop happening or it is a bug?

like image 270
AndroidMechanic - Viral Patel Avatar asked Jun 16 '16 10:06

AndroidMechanic - Viral Patel


4 Answers

Invalidate your Studio cache, restart your device and pc will work. Sometimes the problem with port also, just try after changing the usb port of your pc also.

like image 148
Neo Avatar answered Nov 05 '22 01:11

Neo


Re-enabling USB Debugging fixed the problem

Settings > Developer Options > Disable & Re-enable USB Debugging

like image 35
Merbin J Anselm Avatar answered Nov 04 '22 23:11

Merbin J Anselm


You just need to restart ADB , no need to restart your PC or Phone

Try the below steps:

Go to the Android SDK platform-tools directory in the command prompt

Type adb kill-server
Then type adb start-server

Now try re-connecting ...

It Worked!

In my case I was debugging over wifi for a long time , then the ADB server needed to be refreshed to see the connected devices again

It Happened on Pixel device running Android 8.1.0 with Android Studio 3.0

Cheers!

like image 7
Fahad Avatar answered Nov 04 '22 23:11

Fahad


Try Disabling and Re-Enabling * USB debugging. *

Under your developer option menu

This solved my issue.

like image 2
Vicky Salunkhe Avatar answered Nov 04 '22 23:11

Vicky Salunkhe