I have the Android Emulator running in my Ubuntu VM and just installed an apk file trough the console. The emulator and adb have many options to view what is going on on the device. But how can I get a list of services that are currently running? I'm trying to find out if a specific app installes a notify service to view (unwanted) ads. I even know the services' name.
PS.: I'm an advanced beginner - but not advanced enough. So thanks for your help.
Back in Settings, head into Developer Options. You should see “Running services” a little way down this menu—that's what you're looking for. Once you tap “Running services,” you should be presented with a familiar screen—it's exactly the same one from Lollipop.
dumpsys is a tool that runs on Android devices and provides information about system services. You can call dumpsys from the command line using the Android Debug Bridge (ADB) to get diagnostic output for all system services running on a connected device.
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.
First, the easiest way to do what you're trying to do is to launch an Android Broadcast when the app is killed manually, and define a custom BroadcastReceiver to trigger a service restart after that. Dear Dr Sabri Allani, If your Service is started by your app then actually your service is running on main process.
You can get the list with the following command :
adb shell dumpsys activity services
If you just need a simple list without all the detail dumpsys generates, use:
adb shell service list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With