Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Emulator: How can I get a list of services that are running

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.

like image 279
Jasi Avatar asked Aug 28 '12 10:08

Jasi


People also ask

How do I find out what services are running on my Android?

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.

How do you get Dumpsys?

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.

What are adb commands?

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.

How run service in background Android when app is killed?

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.


2 Answers

You can get the list with the following command :

adb shell dumpsys activity services 
like image 95
Dalmas Avatar answered Oct 26 '22 11:10

Dalmas


If you just need a simple list without all the detail dumpsys generates, use:

adb shell service list 
like image 36
Paul Ratazzi Avatar answered Oct 26 '22 11:10

Paul Ratazzi