execute mobile command
Execute a mobile command-line and return its output.
Name | Description | Type | Modifier |
---|---|---|---|
command | Command to be executed | String | None |
argument | (Optional) Define an argument using the JSON serializable for the current action definition. | String | None |
variable | (Optional) Variable to receive the command output. | String | None |
The command output when executing a mobile command-line.
This action may be used within the following project items: test modules and user-defined actions.
Suppose you may want to issue two commands in your automation script.
- One command is to launch an application, such as MapsActivity.
- The other is to return information relating to the current mobile device.
command argument variable
execute mobile command mobile: shell {"command":"am start -n com.google.android.apps.maps/com.google.android.maps.MapsActivity"} >> ac_output
 
command variable
execute mobile command mobile:deviceInfo >> ac_output
- This built-in action is supported only on Windows test controllers; it is effective on mobile devices test platforms.
- The execute mobile command action can be invoked to execute any commands that are supported by Appium. (For further details, refer to the Help topic for this action in docs (Note that in Android, when using the
mobile:shell
command, adb shell requires permission to execute on the device. Additionally, the script must be wrapped with the argumentcommand
. For example, to list all packages, the argument would be{'command': 'pm list packages'}
)). Learn more above.