Can't launch application through Android Studio (logcat [DEAD])

前端 未结 3 987
[愿得一人]
[愿得一人] 2020-12-28 10:01

For the last two days the app I\'m working on is showing up as [DEAD] in logcat and when I try to launch the app through the run button in Android Studio all seems fine, exc

3条回答
  •  我在风中等你
    2020-12-28 10:40

    The above error is due to

    java.io.IOException

    which causes the current adb-connection to disconnect and connect to the new adb-connection request made by another software .

    java.io.IOException: An established connection was aborted by the software in your host machine
    

    When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server.

    The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections.

    Above information can also be seen from its documentation http://developer.android.com/tools/help/adb.html

    When a new application uses the same connection,your Android studio app reports DEAD in logcat. To resolve the issue,use the adb kill-server command

    adb kill-server  //Terminates the adb server process.
    

    and then rerun your application.

提交回复
热议问题