Error: device offline

前端 未结 15 1058
醉梦人生
醉梦人生 2020-12-13 09:36

The emulator is running. But when I write adb shell in my shell I get:

error:device offline

What is the reason for

相关标签:
15条回答
  • 2020-12-13 09:55

    If you are on Linux or Mac, and assuming the offline device is 'emulator-5554', you can run the following:

    netstat -tulpn|grep 5554
    

    Which yields the following output:

    tcp        0      0 127.0.0.1:5554          0.0.0.0:*               LISTEN      4848/emulator64-x86
    tcp        0      0 127.0.0.1:5555          0.0.0.0:*               LISTEN      4848/emulator64-x86
    

    This tells me that the process id 4848 is still listening on port 5554. You can now kill that process with:

    sudo kill -9 4848
    

    and the ghost offline-device is no more!

    0 讨论(0)
  • 2020-12-13 09:58

    If "adb devices" lists your device but as "offline" chances are your path leads to an old version of adb (eg 1.0.29) which has problems with latest Android 4 devices. Make sure "adb version" returns 1.0.31 or greater. Starting with Android 4.2.2, you must confirm on your device that it is being attached to a trusted computer. It will work with adb version 1.0.31 and above.

    0 讨论(0)
  • 2020-12-13 09:59

    In my case

    adb kill-server
    adb connect [ip_address_of_device]
    
    0 讨论(0)
  • 2020-12-13 10:06

    If you are connecting through USB, unplug and plug it in again.

    If you are connecting over WiFi, disable and re-enable WiFi on the phone.

    0 讨论(0)
  • 2020-12-13 10:09

    I went to my phone settings>>Developer options>>Debugging and turned on this option: "Allow ADB debugging in charge only mode" then this problem solved for me. hope to solve for you too.

    0 讨论(0)
  • 2020-12-13 10:11

    Make sure you're superuser.. Instead of 'adb start-server' do 'sudo adb start-server', enter your password (it will not echo), press enter. Then, 'sudo adb devices' and it will show as online.

    0 讨论(0)
提交回复
热议问题