Add command to view running services

mz-dev
Zhuang Ma 8 years ago
parent d84be9f0e3
commit 2b69cd49c1
  1. 17
      README.en.md
  2. 13
      README.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 [<packagename>]
```
`<packagename>` parameter is optional, command with `<packagename>` will output services related with that packagename, and command without `<packagename>` 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>` command commonly used `<command>` as follows:

@ -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 [<packagename>]
```
`<packagename>` 参数不是必须的,指定 `<packagename>` 表示查看与某个包名相关的 Services,不指定表示查看所有 Services。
`<packagename>` 不一定要给出完整的包名,比如运行 `adb shell dumpsys activity services org.mazhuang`,那么包名 `org.mazhuang.demo1`、`org.mazhuang.demo2` 和 `org.mazhuang123` 等相关的 Services 都会列出来。
## 与应用交互
主要是使用 `am <command>` 命令,常用的 `<command>` 如下:

Loading…
Cancel
Save