添加不指定Activity名称启动 (#66)

* add adb launch app without activity name

Signed-off-by: Wang Diyuan <wangdiyuan@bytedance.com>
master
Wang DiYuan 5 years ago committed by Zhuang Ma
parent 59ebf42927
commit a523037358
  1. 16
      README.en.md
  2. 16
      README.md

@ -823,6 +823,7 @@ There are some options addting data for `<INTENT>`, similar to `extra` for Bundl
| `--ela <EXTRA_KEY> <EXTRA_LONG_VALUE> [, <EXTRA_LONG_VALUE ...]` | long array |
### Launch app / Start an Activity
> start with Activity's name
The syntax is:
@ -844,6 +845,21 @@ adb shell am start -n org.mazhuang.boottimemeasure/.MainActivity --es "toast" "h
The command above means starting MainActivity of the application with the package name `org.mazhuang.boottimemeasure` with an extra string information (key is 'toast' and value is 'hello, world').
> start without Activity's name
The syntax is:
```sh
adb shell monkey -p <packagename> -c android.intent.category.LAUNCHER 1
```
For example:
```sh
adb shell monkey -p com.tencent.mm -c android.intent.category.LAUNCHER 1
```
The command above means starting the launch activity of WeChat.
### Start a Service
The syntax is:

@ -828,6 +828,7 @@ package:/data/app/ecarx.weather-1.apk
| `--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]` | long 数组 |
### 启动应用/ 调起 Activity
> 指定Activity名称启动
命令格式:
@ -849,6 +850,21 @@ adb shell am start -n org.mazhuang.boottimemeasure/.MainActivity --es "toast" "h
表示调起 `org.mazhuang.boottimemeasure/.MainActivity` 并传给它 string 数据键值对 `toast - hello, world`
> 不指定Activity名称启动(启动主Activity)
命令格式:
```sh
adb shell monkey -p <packagename> -c android.intent.category.LAUNCHER 1
```
例如:
```sh
adb shell monkey -p com.tencent.mm -c android.intent.category.LAUNCHER 1
```
表示调起微信主界面。
### 调起 Service
命令格式:

Loading…
Cancel
Save