diff --git a/README.en.md b/README.en.md index 09bc68d..81467cb 100644 --- a/README.en.md +++ b/README.en.md @@ -35,10 +35,10 @@ Other languages: [:cn: Chinese](./README.md) * [View Reception Activity](#view-reception-activity) * [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) - * [Forcibly stop the application](#forcibly-stop-the-application) + * [Start an Activity](#start-an-activity) + * [Start a Service](#start-a-service) + * [Send a broadcast](#send-a-broadcast) + * [Force stop an application](#force-stop-an-application) * [File Management](#file-management) * [Copy files from a device to a computer](#copy-files-from-a-device-to-a-computer) * [Copy files from a computer to a device](#copy-files-from-a-computer-to-a-device) @@ -656,26 +656,30 @@ Complete packagename is unnecessary. For example, `adb shell dumpsys activity se ## Interact with Applications -Primarily using `am ` command commonly used `` as follows: +The most used syntax for interacting with applications is : +```sh +am +``` +The common commands for `` are as follow: -| Command | use | -|-----------------------------------|----------------------------------------| -| `Start [options] ` | Start `` specified Activity | -| `Startservice [options] ` | Start `` designated Service | -| `Broadcast [options] ` | Send `` designated broadcast | -| `Force-stop ` | stop `` related processes | +| Command | Use | +|-----------------------------------|------------------------------------------------------| +| `start [options] ` | Start an Activity specified by `` | +| `startservice [options] ` | Start the Service specified by `` | +| `broadcast [options] ` | Send a broadcast `` | +| `force-stop ` | Force stop everything associated with ``| -`` very flexible parameters, and write Android program code corresponding to the Intent. +The `` is a flexible parameter which is corresponding to the Intent writing in the application. -Options for determining intent objects as follows: +The options for `` are as follows: | Parameter | Meaning | |------------------|---------------------------------------------------------------------------------------------------------------------------------------| -| `-a ` | specified action, such as `android.intent.action.VIEW` | -| `-c ` | specify a category, such as `android.intent.category.APP_CONTACTS` | -| `-n ` | specify the full component name, which is used to explicitly specify the start Activity, such as `com.example.app / .ExampleActivity` | +| `-a ` | Specify the intent action, such as `android.intent.action.VIEW`. You can declare this only once. | +| `-c ` | Specify an intent category, such as `android.intent.category.APP_CONTACTS` | +| `-n ` | Specify the component name with package name prefix to create an explicit intent, such as `com.example.app/.ExampleActivity` | -`` can bring in data, like Bundle write code like: +There are some options addting data for ``, similar to `extra` for Bundle: | Parameter | Meaning | |------------------------------------------------------------------|----------------------------------------| @@ -690,112 +694,112 @@ Options for determining intent objects as follows: | `--eia [, [, ``` -E.g: +For example: ```sh adb shell am start -n com.tencent.mm/.ui.LauncherUI ``` -It represents transfer from the micro-channel main interface. +The command above means starting the launch activity of WeChat. ```sh adb shell am start -n org.mazhuang.boottimemeasure/.MainActivity --es "toast" "hello, world" ``` -Expressed from the transfer `org.mazhuang.boottimemeasure / .MainActivity` key data string and pass it to` toast - hello, world`. +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'). -### Transferred from the Service +### Start a Service -Format: +The syntax is: ```sh adb shell am startservice [options] ``` -E.g: +For example: ```sh adb shell am startservice -n com.tencent.mm/.plugin.accountsync.model.AccountAuthenticatorService ``` -Service represents a transfer from micro-letter. +The command above means starting a service from WeChat. -### Transmits broadcast +### Send a broadcast -Format: +The syntax is: ```sh adb shell am broadcast [options] ``` -All components can be broadcast to be broadcast only to the specified component. +Broadcast intent can be sent to all components or a specified component. -For example, all of the components to broadcast `BOOT_COMPLETED`: +For example, the command of issuing a broadcast intent with `BOOT_COMPLETED` to all of the components is as following: ```sh adb shell am broadcast -a android.intent.action.BOOT_COMPLETED ``` -As another example, only to `org.mazhuang.boottimemeasure / .BootCompletedReceiver` broadcast` BOOT_COMPLETED`: +As another example of issuing a broadcast intent with `BOOT_COMPLETED` only to `org.mazhuang.boottimemeasure / .BootCompletedReceiver` is as following: ```sh adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n org.mazhuang.boottimemeasure/.BootCompletedReceiver ``` -Such usage is very practical in the test, such as a broadcast scenes difficult to manufacture, can be considered to transmit broadcast in this way. +The command of issuing a broadcast intent is very useful in the test, especially when a broatcast intent is hard to generate normally, it would be of great use to send the broadcast intent by the command. -Both predefined broadcast transmission system can also send a custom broadcast. The following is part of the normal pre-defined radio and Trigger timing: +Both system predefined and custom broadcast intent are able to be sent. The following is part of the system predefined broadcast intents and the triggers: -| Action | trigger timing | +| Action | Trigger | |-------------------------------------------------|--------------------------------------------------------------------| -| android.net.conn.CONNECTIVITY_CHANGE | Fi changes | -| android.intent.action.SCREEN_ON | screen lit | +| android.net.conn.CONNECTIVITY_CHANGE | network connectivity changes | +| android.intent.action.SCREEN_ON | screen on | | android.intent.action.SCREEN_OFF | screen off | -| android.intent.action.BATTERY_LOW | low battery, low battery prompt box will pop up | -| android.intent.action.BATTERY_OKAY | electricity restored | -| android.intent.action.BOOT_COMPLETED | equipment Booted | -| android.intent.action.DEVICE_STORAGE_LOW | storage space is running low | -| android.intent.action.DEVICE_STORAGE_OK | storage space recovery | -| android.intent.action.PACKAGE_ADDED | install a new application | -| android.net.wifi.STATE_CHANGE | WiFi connection status change | -| android.net.wifi.WIFI_STATE_CHANGED | WiFi state to the On / Off / Starting up / shutting down / Unknown | -| android.intent.action.BATTERY_CHANGED | battery level changes | -| android.intent.action.INPUT_METHOD_CHANGED | system input method changes | -| android.intent.action.ACTION_POWER_CONNECTED | external power connector | -| android.intent.action.ACTION_POWER_DISCONNECTED | disconnected from external power | -| android.intent.action.DREAMING_STARTED | system began Sleep | -| android.intent.action.DREAMING_STOPPED | system stops Sleep | -| android.intent.action.WALLPAPER_CHANGED | wallpaper changes | -| android.intent.action.HEADSET_PLUG | insert earphone | -| android.intent.action.MEDIA_UNMOUNTED | unload external media | -| android.intent.action.MEDIA_MOUNTED | mount external media | -| android.os.action.POWER_SAVE_MODE_CHANGED | power-saving mode is turned on | - -* (Above broadcast can be used to trigger adb) * - -### Forcibly stop the application - -command: +| android.intent.action.BATTERY_LOW | low battery, corresponding to the "Low battery warning" system dialog | +| android.intent.action.BATTERY_OKAY | the battery is now okay after being low | +| android.intent.action.BOOT_COMPLETED | device boot finished | +| android.intent.action.DEVICE_STORAGE_LOW | low memory condition on the device | +| android.intent.action.DEVICE_STORAGE_OK | low memory condition on the device no longer exists | +| android.intent.action.PACKAGE_ADDED | a new application has been installed | +| android.net.wifi.STATE_CHANGE | WiFi connection status changed | +| android.net.wifi.WIFI_STATE_CHANGED | Wi-Fi has been enabled, disabled, enabling, disabling, or unknown | +| android.intent.action.BATTERY_CHANGED | battery level changed | +| android.intent.action.INPUT_METHOD_CHANGED | system input method changed | +| android.intent.action.ACTION_POWER_CONNECTED | external power connected to the device | +| android.intent.action.ACTION_POWER_DISCONNECTED | external power removed from the device | +| android.intent.action.DREAMING_STARTED | system starts dreaming | +| android.intent.action.DREAMING_STOPPED | system stops dreaming | +| android.intent.action.WALLPAPER_CHANGED | wallpaper changeed | +| android.intent.action.HEADSET_PLUG | wired headset plugged in or unplugged | +| android.intent.action.MEDIA_UNMOUNTED | external media is present, but not mounted at its mount point | +| android.intent.action.MEDIA_MOUNTED | external media is present and mounted at its mount point | +| android.os.action.POWER_SAVE_MODE_CHANGED | power-saving mode changed | + +*(Above broadcast intents are all available to be sent via adb commands)* + +### Force stop an application + +The syntax is: ```sh adb shell am force-stop ``` -Command Example: +For example: ```sh adb shell am force-stop com.qihoo360.mobilesafe ``` -Stop all processes and services represents 360 security guards. +The command above means stopping all processes and services related to the package name `com.qihoo360.mobilesafe`. ## File Management