Krista Marie
Krista Marie

Reputation: 97

Galaxy S9 Device Keeps Appearing as "Offline" when emulating

My Galaxy S9 device keeps appearing as "Offline" when I try to debug. It was working with the same application previously, and nothing changed. I receive this error: Session 'app': Error Installing APK and com.android.ddmlib.AdbCommandRejectedException: device offline Error while Installing APK

Things I've tried:

Emulating didn't work either, but I was able to fix that by installing the Intel HAXM installer. Is there another set of developer tools I need to debug on hardware?

Upvotes: 0

Views: 1195

Answers (4)

Arthur Silveira
Arthur Silveira

Reputation: 21

just today I've been through a similar situation with my MOTO G5: Everything was working just fine a few weeks ago and somehow it stopped working (maybe some windows update messed with something), device was always "offline" when using "adb devices". I've tried lots of different suggestions (reinstall drivers, disable/enable usb debug, adb kill/restart-server, change cable, change USB port, restart PC, restart phone, just revoke usb auth (see below) with no success.

Then I realized: what if I delete the RSA keys, and just then revoke the USB debug authorization? And finally, it worked! Thanks to this website I've quickly found the location of the keys: Refresh Android Debug Bridge Keys.

On Windows, they are on folder C:\Users\{username}\.android\ After that, next time I plugged the phone and performed a "adb devices" finally, it showed "unauthorized" instead of "offline". Then on the phone screen there was a popup requesting authorization. Once authorized again, voila: everything working!

Since I didn't find this suggestion on any other forum before, I decided to post here my personal solution. Maybe I could help some other fellows with same issue.

Upvotes: 2

Ankit Shah
Ankit Shah

Reputation: 11

This may be a late answer, but this is what worked for me. When prompted on the computer to choose what happens when the device is plugged in, choose "Do Nothing" or simply ignore it. On the Device, When asked "Allow Access to phone data?" tap AllOW. This is what you should see when you swipe down from top.

In the options above, select charge this phone wait for a few seconds and then again select either Transfer Files or Connect a MIDI Device The device should show up in your list after some time. If it doesn't, disable and then re-enable USB debugging from the developer options.

Upvotes: 0

Martin Zeitler
Martin Zeitler

Reputation: 76769

try adb kill-server && adb start-server && adb devices

besides, this is no emulation, but debug on physical hardware.

one could also define this script as "external tool" in Android Studio.

Upvotes: 0

nupadhyaya
nupadhyaya

Reputation: 1944

Disable and re-enable adb debugging in your device's Developer options. Also, when you connect the device to your computer, you will get a prompt in the device asking if you want to trust the computer, Click ok.

Upvotes: 0

Related Questions