Error: device offline

前端 未结 15 1155
醉梦人生
醉梦人生 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!

提交回复
热议问题