Overview
Suppose you manage hundreds or thousands of Android devices. You may encounter a situation where you must manually configure an app or a system setting with no remote APIs. We will show you a few tips on simulating input events, such as swipes, touches, key inputs, menu openings, and more. Once you get the hang of it, there’s no limit to what you can do remotely. Instead of using the Remote Screen Control command, which only allows you to perform one command at a time, Remote Execute allows you to simultaneously automate the process to hundreds or thousands of devices by utilizing remote input and touch events.
Types of Remote Execute Commands
There are two main ways of using Remote Execute:
- – Create a shell script, send it to the fleet of devices using the file bundle, and execute it using the Remote Execute commands (in one Workflow command)
- – Using individual Remote Execute commands, without combining them in a Workflow command.
On another page, we use successive Commands & Scripts commands and show how to combine remote input events in a Workflow command.
Accessing the Commands & Scripts Command
There are several methods to create a new Commands & Scripts command:
- From the Device Dashboard, from the Repositories screen,
- From a device’s three-dot menu,
- From the Device Dashboard for a particular device,
- From the Bulk Actions button.
Method One: From the Sidebar Menu
To access the Commands & Scripts command from the sidebar menu:
1. On the sidebar menu in the Overview Dashboard, click Deployment>Commands & Scripts.

A repository opens, showing all existing Commands & Scripts commands.

Figure 1: Commands & Scripts Repository
Method Two: From the Device’s Three-Dot Menu
To access the Commands & Scripts option from the device’s three-dot menu:
1. On the sidebar menu in the Overview Dashboard, click the Devices icon.

The Devices Table opens, with a list of available devices.
2. Select the device to which you wish to apply the Commands & Scripts option and click on the device’s three-dot menu in the far-right column.

3. In the drop-down menu, go to Deploy>Commands & Scripts.

4. The Commands & Scripts repository opens, displaying all stored script command items.

Method Three: From the Device Dashboard
To access the Commands & Scripts option from the device’s Device Dashboard:
1. On the sidebar menu in the Overview Dashboard, click the Devices icon to open the Devices Table.

2. Select the device to which you wish to apply the Commands & Scripts command and click on the row of that device in the Devices Table.

The device’s Device Dashboard opens:

3. In the right-hand section, click on the Repositories Actions>Commands & Scripts.
The Commands & Scripts repository will open.

Method Four: From the Bulk Actions Button
To access the Commands & Scripts Command from the Bulk Actions button:
1. On the left side main menu in the Overview Dashboard, click the Devices icon to open the Devices Table.
2. Select the device to which you wish to apply the Commands and Scripts command by clicking on the checkbox in the far-left column of that device.

Note that the Bulk Actions button becomes active.
3. Click on Bulk Actions>Deploy>Commands & Scripts.

The Commands & Scripts repository opens.

Creating a New Command
Note! You can run these command-line commands if you have high-level local device privileges. Use these commands only if you are familiar with writing batch commands and scripts, and you know what happens as a result.
1. Open the Commands & Scripts repository, with all of the stored Commands & Scripts options, by one of the methods mentioned above.

2. Click on the Add New button in the lower left to add a new command and assign a name to it.

Here are recommended inputs for the other fields:
- Command– This is where you write the main command, as in the table below.
- Arguments– This is where you write the command arguments.
- Command line – This is if you need to execute a command consisting of a single line.
- Script – This is if you want to execute a script of several lines.
- Wait for Exit– This will indicate whether the command result will be sent to you after the command finishes running on the remote device. It is not necessary to select this option.
- Collect output– This will indicate if the standard output of the process is collected as part of the command result. It is not necessary to select this option.
- Run with high privileges– This allows you to run the command with higher privileges on the local device. It is advised to select this option.
- Set as private – Clicking on this sliding button will make the command private so that it is visible only to you.
3. Click Confirm. The Remote Command option will be saved and will appear in the Commands & Scripts repository.
Input Event Examples
Here are a few sample remote Android command-line commands that you can send to a device.
Command:
- Input
Arguments:
- keyevent
- text
- tap
- swipe
| Function | Command | Arguments | Wait | Collect | Privileges | |
| 1 | To type the string “1234” | input | text 1234 | X | ||
| 2 | To type a string: “12 34” | input | text 12%s34 | X | ||
| 3 | To simulate the “Home” button | input | keyevent 3 | X | ||
| 4 | To simulate the menu button | input | keyevent 82 | X | ||
| 5 | To simulate a tap in screen coordinates 300 x 550 | input | tap 300 500 | X | ||
| 6 | To simulate a swipe from coordinates 300 x 550 to coordinates 900 X 600 with speed of 250ms | input | swipe 300 500 900 600 250 | X | ||
| 7 | To simulate a long press with a duration of 1000ms in coordinates 300 x 550 | input | swipe 300 500 300 500 1000 | X |
Remote Input Example
Let’s illustrate the Commands & Scripts command with a simple example. First, here is how we’d supply the rest of the commands to get the remote device to the Yahoo! Homepage:
1. Supply the command and arguments and click Confirm.

The new command will appear in the Commands & Scripts repository.
2. Select this command by clicking on it and then clicking the Apply button in the lower right. You will receive a confirmation in the lower right of the screen, telling you that the command has been sent properly.
3. The text www.yahoo.com will appear in the address bar of the remote device.

Remote Input Workflow
We can also put together a workflow of several Remote Execute commands and send it to one or even several devices.
To create a Workflow of Commands & Scripts commands:
1. Open the Workflow command. For example, from the device’s three-dot menu, go to Automate>Workflow.


2. Click Add New in the lower left corner to create a new Workflow item.

3. Assign a name and description to the Workflow. We gave our workflow the name “Yahoo Homepage”.
4. Click on the Commands icon.

5. Click on Add Command and open the Remote Execute window.

6. Select the combination of Remote Execute commands that will open the Yahoo! Homepage. For our example, we’ll select the following: a. the Remote Execute command to type the URL for the Yahoo! Homepage in the search bar, and b. a Remote Execute command that simulates the Enter key.

7. Click Confirm to save the Workflow.

8. In the Workflow window, select the Yahoo Homepage workflow, and click Apply. The workflow will be sent to the remote device, displaying the Yahoo! homepage.

List of Keyevent Commands
| 0 –> “KEYCODE_UNKNOWN” | 43 –> “KEYCODE_O” |
| 1 –> “KEYCODE_MENU” | 44 –> “KEYCODE_P” |
| 2 –> “KEYCODE_SOFT_RIGHT” | 45 –> “KEYCODE_Q” |
| 3 –> “KEYCODE_HOME” | 46 –> “KEYCODE_R” |
| 4 –> “KEYCODE_BACK” | 47 –> “KEYCODE_S” |
| 5 –> “KEYCODE_CALL” | 48 –> “KEYCODE_T” |
| 6 –> “KEYCODE_ENDCALL” | 49 –> “KEYCODE_U” |
| 7 –> “KEYCODE_0” | 50 –> “KEYCODE_V” |
| 8 –> “KEYCODE_1” | 51 –> “KEYCODE_W” |
| 9 –> “KEYCODE_2” | 52 –> “KEYCODE_X” |
| 10 –> “KEYCODE_3” | 53 –> “KEYCODE_Y” |
| 11 –> “KEYCODE_4” | 54 –> “KEYCODE_Z” |
| 12 –> “KEYCODE_5” | 55 –> “KEYCODE_COMMA” |
| 13 –> “KEYCODE_6” | 56 –> “KEYCODE_PERIOD” |
| 14 –> “KEYCODE_7” | 57 –> “KEYCODE_ALT_LEFT” |
| 15 –> “KEYCODE_8” | 58 –> “KEYCODE_ALT_RIGHT” |
| 16 –> “KEYCODE_9” | 59 –> “KEYCODE_SHIFT_LEFT” |
| 17 –> “KEYCODE_STAR” | 60 –> “KEYCODE_SHIFT_RIGHT” |
| 18 –> “KEYCODE_POUND” | 61 –> “KEYCODE_TAB” |
| 19 –> “KEYCODE_DPAD_UP” | 62 –> “KEYCODE_SPACE” |
| 20 –> “KEYCODE_DPAD_DOWN” | 63 –> “KEYCODE_SYM” |
| 21 –> “KEYCODE_DPAD_LEFT” | 64 –> “KEYCODE_EXPLORER” |
| 22 –> “KEYCODE_DPAD_RIGHT” | 65 –> “KEYCODE_ENVELOPE” |
| 23 –> “KEYCODE_DPAD_CENTER” | 66 –> “KEYCODE_ENTER” |
| 24 –> “KEYCODE_VOLUME_UP” | 67 –> “KEYCODE_DEL” |
| 25 –> “KEYCODE_VOLUME_DOWN” | 68 –> “KEYCODE_GRAVE” |
| 26 –> “KEYCODE_POWER” | 69 –> “KEYCODE_MINUS” |
| 27 –> “KEYCODE_CAMERA” | 70 –> “KEYCODE_EQUALS” |
| 28 –> “KEYCODE_CLEAR” | 71 –> “KEYCODE_LEFT_BRACKET” |
| 29 –> “KEYCODE_A” | 72 –> “KEYCODE_RIGHT_BRACKET” |
| 30 –> “KEYCODE_B” | 73 –> “KEYCODE_BACKSLASH” |
| 31 –> “KEYCODE_C” | 74 –> “KEYCODE_SEMICOLON” |
| 32 –> “KEYCODE_D” | 75 –> “KEYCODE_APOSTROPHE” |
| 33 –> “KEYCODE_E” | 76 –> “KEYCODE_SLASH” |
| 34 –> “KEYCODE_F” | 77 –> “KEYCODE_AT” |
| 35 –> “KEYCODE_G” | 78 –> “KEYCODE_NUM” |
| 36 –> “KEYCODE_H” | 79 –> “KEYCODE_HEADSETHOOK” |
| 37 –> “KEYCODE_I” | 80 –> “KEYCODE_FOCUS” |
| 38 –> “KEYCODE_J” | 81 –> “KEYCODE_PLUS” |
| 39 –> “KEYCODE_K” | 82 –> “KEYCODE_MENU” |
| 40 –> “KEYCODE_L” | 83 –> “KEYCODE_NOTIFICATION” |
| 41 –> “KEYCODE_M” | 84 –> “KEYCODE_SEARCH” |
| 42 –> “KEYCODE_N” | 85 –> “TAG_LAST_KEYCODE” |
More Examples of Android ADB Commands
Here are some examples of Android commands that you can employ in the Remote Execute command:
| Function | CMD | Arguments | Wait for Exit | Collect Output | Run with High Privileges | |
| 1 | Disable Google Play store |
pm | disable com.android.vending | X | ||
| 2 | Get a list of running apps and display result |
top | -n 1 | X | X | X |
| 3 | Open a website using a default browser |
am | start -a android.intent.action.VIEW -d https://www.radix-int.com | |||
| 4 |
Run using Monkey command |
monkey | -p org.chromium.webview_shell -c android.intent.category.LAUNCHER 1 | X | ||
| 5 | Clear app data | am | clear com.android.browser | X |
Example of Remote Execution of a Command
Let us perform a simple example of an Android command that we send to a device remotely.
1. In the sidebar menu, click on the Devices icon to see a list of all of the available devices.
2. Find the device to which you would like to execute the command. Use the Search Bar at the top to narrow down the selection.

3. Click on the line of the device listed in the Devices Table and select Repositories Actions>Commands & Scripts in the menu on the far right.

4. In the Search bar at the top of the window, enter “top” to find the “top” command.

This is what the “top” command looks like “under the hood” when we click on the Edit icon on the Commands & Scripts tile:

5. Click on the tile “top” and click Apply.

You will get an alert in the lower left-hand corner, indicating that the command has been executed.

When you click on the Remote Execute command, the Command Status window opens, showing you the result when the command “top” is executed:

Executing a Command to Several Devices
In the previous example, we executed a command-line Android command on a single device. The Bulk Actions button will also allow you to execute a command-line command on several devices.
To execute a command on several devices:
1. Click on Devices in the sidebar menu to open the Devices Table.
2. Select the devices to which you would like to execute the command-line command by clicking on their checkboxes.

3. Click on Bulk Actions>Deploy>Commands and Scripts.

4. In the Commands & Scripts repository, select the command that you want to apply to the selected devices, and click Apply. We selected the “top” command again in the example above.

The command will be sent to the selected devices.
If you click on the command bar in the bottom middle of the Devices Table, you will be able to see the status of the remote command that you sent to the selected devices. In the example below, we see that the command is in “Pending” status.

Figure 3: Result of the Remote Command Execution