How to simulate a service killed by the Android system

后端 未结 4 890
不思量自难忘°
不思量自难忘° 2021-01-04 19:07

While developing I wanted to test the situation where the system kills a service. This is because I\'m loosing connection when communicating between the Android Wear and the

4条回答
  •  [愿得一人]
    2021-01-04 19:45

    As of 2020 we have to do it manually (since we don't have Android Monitor or DDMS anymore).

    This was tested on Linux. You need root permission for the device (how to get root for an AVD).

    1. Getting the PID (first number): adb shell ps | grep -i
    2. Killing the process: adb shell kill

提交回复
热议问题