- ADB (Android Debug Bridge)
- scrcpy (Android Screen Mirroring Tool) which runs on top of ADB.
You can run ADB over USB or WiFi, but WiFi is preferred because
- it frees up USB port for charging,
- no messy cables, and
- you can debug from VM.
1. Prepare phone for WiFi debug.
- Enable Developer options (normally hidden), by tapping Build number 7 times.
- Disable Auto Blocker.
- Enable Wireless debugging.
2. Pair phone and desktop.
On Wireless debugging section, you’ll see
- Device name
- IP address & Port — eg. 192.168.1.25:22222
- Tap Pair device with pairing code, and you get a popup with
- Wi-Fi pairing code — eg. 123456
- IP address & Port — eg. 192.168.1.25:44444
adb pair 192.168.1.25:44444
- Enter the pairing code — eg. 123456.
adb connect 192.168.1.25:22222
- Use the phone port, not the pairing port just used.
- Phone should say “Currently connected”.
adb devices
- The phone IP:port should be listed
scrcpy
- You can type/click on desktop, and the phone will act on those inputs.
- Screenshot for Samsung Galaxy A16

You can send keyboard/mouse input to the phone using ADB, instead of manually typing and clicking.
- On the front page, with Google Search in the centre,
adb shell input tap 540 1120 --- tap Google Search
adb shell input text "distrowatch.com" --- type "distrowatch.com"
adb shell input keyevent KEYCODE_ENTER --- press <Enter>
- There are other keycodes:
- 3 buttons at the bottom (recent apps, home, back)
KEYCODE_RECENT_APPS
KEYCODE_HOME
KEYCODE_BACK
- phone related
KEYCODE_0 ... KEYCODE_9
KEYCODE_STAR
KEYCODE_POUND
KEYCODE_CALL
KEYCODE_ENDCALL
- text entry
KEYCODE_A ... KEYCODE_Z
KEYCODE_AT
KEYCODE_PERIOD
KEYCODE_PLUS
KEYCODE_MINUS
KEYCODE_SLASH
KEYCODE_SPACE
KEYCODE_DEL
KEYCODE_ENTER
KEYCODE_TAB
4. Determine X and Y positions.
- Enable Pointer location.
- X,Y positions of screen touch will be printed at the top of screen.
adb shell getevent -l
- ABS_MT_POSITION_X — x position in hex
- ABS_MT_POSITION_Y — y position in hex