Android 模拟器:如何获取正在运行的服务列表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12157442/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 09:55:28  来源:igfitidea点击:

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

androidandroid-emulatorandroid-servicemonitoringmonitor

提问by Jasi

I have the Android Emulatorrunning in my Ubuntu VMand 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 servicesthat 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.

我在我的Ubuntu VM 中运行了Android 模拟器,并且刚刚通过控制台安装了一个 apk 文件。模拟器和 adb 有许多选项可以查看设备上发生的事情。但是如何获取当前正在运行的服务列表?我试图找出特定应用程序是否安装了通知服务来查看(不需要的)广告。我什至知道这些服务的名字。

PS.: I'm an advanced beginner - but not advanced enough. So thanks for your help.

PS.:我是一个高级初学者 - 但还不够先进。所以谢谢你的帮助。

回答by Dalmas

You can get the list with the following command :

您可以使用以下命令获取列表:

adb shell dumpsys activity services

回答by Paul Ratazzi

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

如果您只需要一个没有 dumpsys 生成的所有详细信息的简单列表,请使用:

adb shell service list

回答by starkej2

Logcat might help you out as well

Logcat 也可以帮助你