The emulator is running. But when I write adb shell
in my shell I get:
error:device offline
What is the reason for
Install this tool (link) and try the following code, do not forget to have the device connected and be attentive to any message.
cd .... platform-tools/
adb kill-server
adb start-server
for me, it was by enabling USB Debugging in developer option:
just run adb install apk path after and it will works
When I got that same error, I just unplugged and plugged in it and the error disappeared.
It happened to me once. I just rebooted the device, and this solved the problem for me.
Try to run:
adb kill-server
adb start-server
Still device offline, please restart device.
Method 1 :
run this commands in your linux terminal
sudo adb kill-server
sudo adb devices
run this commands in your CMD
adb kill-server
adb devices
"adb devices" result must show any device with id. If instead of id you are getting off-line means you need to give permission in your tab. Once you enable USB Debugging in android and connect the device for the first time you will get an alert dialog for giving permission. If you are not getting any pop-up then click on Revoke USB Permission in Developer option the try once.
Method 2:
Change the device connected mode from Media to Camera, sometimes this helped me.
Method 3 :
Update the adb as well as device drivers.