From 2b69cd49c1501eeb1b7d49d6e106108e696f35e2 Mon Sep 17 00:00:00 2001 From: Zhuang Ma Date: Tue, 1 Nov 2016 21:03:46 +0800 Subject: [PATCH] Add command to view running services --- README.en.md | 17 +++++++++++++++-- README.md | 13 +++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index f5c9791..a3d69b1 100644 --- a/README.en.md +++ b/README.en.md @@ -33,7 +33,8 @@ Other languages: [:cn: Chinese](./README.md) * [Uninstalling](#uninstalling) * [Clear app cache data](#clear-app-cache-data) * [View Reception Activity](#view-reception-activity) -* [Applications to interact with](#applications-to-interact-with) + * [View Running Services](#view-running-services) +* [Interact with Applications](#interact-with-applications) * [Transferred from Activity](#transferred-from-activity) * [Transferred from the Service](#transferred-from-the-service) * [Transmits broadcast](#transmits-broadcast) @@ -621,7 +622,19 @@ mFocusedActivity: ActivityRecord{8079d7e u0 com.cyanogenmod.trebuchet/com.androi Where `com.cyanogenmod.trebuchet / com.android.launcher3.Launcher` is currently in the foreground Activity. -## Applications to interact with +### View Running Services + +command: + +```sh +adb shell dumpsys activity services [] +``` + +`` parameter is optional, command with `` will output services related with that packagename, and command without `` will output all services. + +Complete packagename is unnecessary. For example, `adb shell dumpsys activity services org.mazhuang` will output services related with `org.mazhuang.demo1`, `org.mazhuang.demo2` and `org.mazhuang123`, etc. + +## Interact with Applications Primarily using `am ` command commonly used `` as follows: diff --git a/README.md b/README.md index 75de572..5934a83 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Other languages: [:gb: English](./README.en.md) * [卸载应用](#卸载应用) * [清除应用数据与缓存](#清除应用数据与缓存) * [查看前台 Activity](#查看前台-activity) + * [查看正在运行的 Services](#查看正在运行的-services) * [与应用交互](#与应用交互) * [调起 Activity](#调起-activity) * [调起 Service](#调起-service) @@ -621,6 +622,18 @@ mFocusedActivity: ActivityRecord{8079d7e u0 com.cyanogenmod.trebuchet/com.androi 其中的 `com.cyanogenmod.trebuchet/com.android.launcher3.Launcher` 就是当前处于前台的 Activity。 +### 查看正在运行的 Services + +命令: + +```sh +adb shell dumpsys activity services [] +``` + +`` 参数不是必须的,指定 `` 表示查看与某个包名相关的 Services,不指定表示查看所有 Services。 + +`` 不一定要给出完整的包名,比如运行 `adb shell dumpsys activity services org.mazhuang`,那么包名 `org.mazhuang.demo1`、`org.mazhuang.demo2` 和 `org.mazhuang123` 等相关的 Services 都会列出来。 + ## 与应用交互 主要是使用 `am ` 命令,常用的 `` 如下: