Execute Mobile Shell Command
Command description
Execute a shell command on the mobile device, for example to query system information, read files, or troubleshoot the device.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Mobile Device Object | Phone | Connected mobile object |
| Shell Command | str | Shell command to run on the mobile device |
Command Output Parameters
| Output parameters | Output parameter type | Description |
|---|---|---|
| Return Value | int | Shell command exit code; 0 usually indicates success |
| Output | str | Standard output produced by the shell command |
Type definition reference
Return value description
| return value | Description |
|---|---|
0 | Command execution successful |
Not 0 | The command failed or returned a nonzero status; inspect Output for details |
Common command examples
ls /sdcard/Download
pm list packages
getprop ro.product.model
tip
Enable Developer options on the mobile device, then connect it to the computer with a USB cable. See Connect Mobile Device
Example
Run the ls command