Viral Patel
Viral Patel

Reputation: 33438

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?

Upvotes: 31

Views: 45047

Answers (15)

FEELIX
FEELIX

Reputation: 427

  1. restart and in validate android studio
  2. Disable and enable usb debugging
  3. unplug device
  4. plug device
  5. uninstall existing app
  6. kill and start adb server
  7. YourComputer@YourComputer:~/Android/Sdk/platform-tools$ adb kill-server
  8. YourComputer@YourComputer:~/Android/Sdk/platform-tools$ adb start-server
  • daemon not running; starting now at tcp:5037
  • daemon started successfully
  1. Run app again
  2. if it doesn't work ensure u cable or connection is good

Upvotes: 0

Mohammad Davari
Mohammad Davari

Reputation: 450

Change USB port and use another USB port of your PC or Laptop. This works for me!

Upvotes: 0

Abdul Hanan
Abdul Hanan

Reputation: 21

I got it solved for mac Android>Preferences>Build,Execution, Deployment>Debugger ---Uncheck => Use libusb backend

for windows File>Settings>Build,Execution, Deployment>Debugger ---Uncheck => Use libusb backend

Upvotes: 1

Mustafa Essam
Mustafa Essam

Reputation: 47

Had the Same Problem .. Solved after restart My AS and My Device, Don't forget to check your Caple.

Upvotes: 0

Tools>>AVD Manager >>Actions >>Select you Device More >> Wipe Data

Start again Device

Upvotes: -2

Vicky Salunkhe
Vicky Salunkhe

Reputation: 11005

Try Disabling and Re-Enabling * USB debugging. *

Under your developer option menu

This solved my issue.

Upvotes: 2

Hunter
Hunter

Reputation: 3362

I have changed it from Charge The Device to File Transfer and it works every time.

Upvotes: 0

Merbin J Anselm
Merbin J Anselm

Reputation: 1044

Re-enabling USB Debugging fixed the problem

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

Upvotes: 8

Zubaer Haque
Zubaer Haque

Reputation: 172

Had Same Problem, Just rebooted and its fixed, its the connection problem actually, so check phone's cable first

Upvotes: 1

Karthik Golla
Karthik Golla

Reputation: 11

I changed settings in the Developer options in my phone and it started working just fine.

1.Permission to install apps from unknown source 2.permission to install apps via USB.

Upvotes: 1

Alessandro Caliaro
Alessandro Caliaro

Reputation: 5768

I have "revoked USB debugging authorizations " under "Developer options" and it works

Upvotes: 1

Abolfazl Miadian
Abolfazl Miadian

Reputation: 3159

unplug your device and click on run and after visiting selection window, plug your device again and select your connected device. it will work!

Upvotes: 0

Fahad
Fahad

Reputation: 2053

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!

Upvotes: 7

Ishmael MIRZAEE
Ishmael MIRZAEE

Reputation: 1210

In my case, I have activated Unknown sources in my cellphone to let application installation. Because the app hasn't accepted by Google yet, so it will block installation process.

To activate Unknown sources (In my device Samsung Galaxy Tab A 9.7 is):

Lock screen and security

Upvotes: 0

Neo
Neo

Reputation: 3584

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.

Upvotes: 25

Related Questions