Input Control
Prerequisites
Input control commands require an active device connection. Run pb connect <device_code> first.
Tap
pb tap <x> <y>
Tap a point on the screen at the given coordinates.
| Parameter | Type | Required | Description |
|---|---|---|---|
x | integer | Yes | X coordinate |
y | integer | Yes | Y coordinate |
Examples:
bash
pb tap 540 960
# Also supports adb-style syntax
pb input tap 540 960text
✓ OKjson
{
"code": 200,
"data": true,
"msg": "OK"
}Swipe
pb swipe <x1> <y1> <x2> <y2>
Perform a swipe gesture using a Bezier curve from one point to another.
| Parameter | Type | Required | Description |
|---|---|---|---|
start_x | integer | Yes | Starting X coordinate |
start_y | integer | Yes | Starting Y coordinate |
end_x | integer | Yes | Ending X coordinate |
end_y | integer | Yes | Ending Y coordinate |
Examples:
bash
# Swipe up (scroll down)
pb swipe 540 1500 540 500
# Also supports adb-style syntax
pb input swipe 540 1500 540 500Text Input
pb text <text>
Input text on the device. Works with the currently focused text field.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to input |
Examples:
bash
pb text "Hello World"
# Also supports adb-style syntax
pb input text "Hello World"Key Event
pb keyevent <key>
Send a key event to the device. Supports both key names and numeric key codes.
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string/integer | Yes | Key name (e.g., HOME) or numeric code (e.g., 3) |
Examples:
bash
# By name
pb keyevent HOME
pb keyevent BACK
pb keyevent ENTER
# By numeric code
pb keyevent 3
# adb-style syntax
pb input keyevent BACKKey Name Reference
| Key Name | Aliases | Code | Description |
|---|---|---|---|
HOME | 3 | Home button | |
BACK | 4 | Back button | |
CALL | 5 | Answer call | |
ENDCALL | 6 | End call | |
DPAD_UP | UP | 19 | D-pad up |
DPAD_DOWN | DOWN | 20 | D-pad down |
DPAD_LEFT | LEFT | 21 | D-pad left |
DPAD_RIGHT | RIGHT | 22 | D-pad right |
DPAD_CENTER | CENTER | 23 | D-pad center/OK |
VOLUME_UP | 24 | Volume up | |
VOLUME_DOWN | 25 | Volume down | |
POWER | 26 | Power button | |
CAMERA | 27 | Camera button | |
CLEAR | 28 | Clear | |
TAB | 61 | Tab | |
SPACE | 62 | Space | |
ENTER | 66 | Enter/confirm | |
DEL | DELETE, BACKSPACE | 67 | Delete (backspace) |
MENU | 82 | Menu | |
NOTIFICATION | 83 | Notification panel | |
SEARCH | 84 | Search | |
MEDIA_PLAY_PAUSE | 85 | Play/pause media | |
MEDIA_STOP | 86 | Stop media | |
MEDIA_NEXT | 87 | Next track | |
MEDIA_PREVIOUS | 88 | Previous track | |
MUTE | 91 | Mute | |
PAGE_UP | 92 | Page up | |
PAGE_DOWN | 93 | Page down | |
ESCAPE | ESC | 111 | Escape |
FORWARD_DEL | 112 | Forward delete | |
CAPS_LOCK | 115 | Caps lock | |
MOVE_HOME | 122 | Move to beginning | |
MOVE_END | 123 | Move to end | |
INSERT | 124 | Insert | |
MEDIA_PLAY | 126 | Play media | |
MEDIA_PAUSE | 127 | Pause media |
TIP
Key names are case-insensitive. You can also use the KEYCODE_ prefix (e.g., KEYCODE_HOME).