# Run ADB Shell

Executes an ADB (Android Debug Bridge) shell command directly on the cloud phone. Use this for advanced operations that are not covered by other RPA nodes, such as installing APKs, taking screenshots, managing files, or querying system properties.

## Parameters

- **[Run ADB Shell]**: Enter the ADB shell command to execute. This is the command that runs inside `adb shell` on the device.
See [Android ADB documentation](https://developer.android.com/tools/adb) for the full command reference.
- **[Timeout]**: Set the maximum run time for the command (in milliseconds). When the timeout is exceeded, the current step is skipped and the workflow proceeds to the next node.


## Output

- **Output Parameters**
  - **Result**: The standard output (stdout) of the executed command, returned as a string.
- **Execution Log**
  - Start Time
  - End Time
  - Duration (ms)
  - Status (Success/Failure)


## Example

### 1. List installed packages

```
pm list packages
```

Returns a list of all installed packages on the device (e.g., `package:com.instagram.android`).

### 2. Take a screenshot and save to device

```
screencap -p /sdcard/screenshot.png
```

Captures the current screen and saves it as a PNG file on the device.

### 3. Get device model information

```
getprop ro.product.model
```

Returns the device model name.

### 4. Clear app data

```
pm clear com.example.app
```

Clears all data for the specified app (cache, database, preferences).

### 5. Simulate a tap at specific coordinates

```
input tap 500 800
```

Taps the screen at coordinates (500, 800). This is useful as an alternative to the [Tap x y](/rparobotic-process-automation/03-node/01-simulation-operations/05-tap-x-y) node when you need to execute it as part of a shell script.

### 6. Input text via ADB

```
input text "hello%sworld"
```

Types text into the currently focused input field. Use `%s` for spaces.

## Tips

- **Set an appropriate timeout**: Some commands (e.g., `pm install`) can take a long time. Set the timeout high enough to avoid premature termination.
- **Check the exit code**: If the command fails, the execution status will be "Failure". Use a [Switch](/rparobotic-process-automation/03-node/03-flow-logic/03-switch) node to handle error cases.
- **Escape special characters**: Shell metacharacters (quotes, pipes, etc.) should be properly escaped.
- **Prefer dedicated nodes when available**: For common operations like tapping, swiping, or launching apps, use the dedicated RPA nodes instead of ADB commands. They are more reliable and easier to maintain.


## Related Nodes

- [Run JS Script](/rparobotic-process-automation/03-node/02-data-processing/01-run-js-script) — for JavaScript-based data processing
- [Tap x y](/rparobotic-process-automation/03-node/01-simulation-operations/05-tap-x-y) — for coordinate-based taps (no ADB needed)
- [Input Text](/rparobotic-process-automation/03-node/01-simulation-operations/08-input-text) — for typing text into input fields