Reputation: 33438
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
Reputation: 427
Upvotes: 0
Reputation: 450
Change USB port and use another USB port of your PC or Laptop. This works for me!
Upvotes: 0
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
Reputation: 47
Had the Same Problem .. Solved after restart My AS and My Device, Don't forget to check your Caple.
Upvotes: 0
Reputation: 1
Tools>>AVD Manager >>Actions >>Select you Device More >> Wipe Data
Start again Device
Upvotes: -2
Reputation: 11005
Try Disabling and Re-Enabling * USB debugging. *
Under your developer option menu
This solved my issue.
Upvotes: 2
Reputation: 3362
I have changed it from Charge The Device to File Transfer and it works every time.
Upvotes: 0
Reputation: 1044
Re-enabling USB Debugging fixed the problem
Settings > Developer Options > Disable & Re-enable USB Debugging
Upvotes: 8
Reputation: 172
Had Same Problem, Just rebooted and its fixed, its the connection problem actually, so check phone's cable first
Upvotes: 1
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
Reputation: 5768
I have "revoked USB debugging authorizations " under "Developer options" and it works
Upvotes: 1
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
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 ...
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
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
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