Scrcpy v1.20
github.com
github.com
It didn't register my mouse and keyboard inputs at first. It worked after I enabled "Allow granting permissions and simulating input via USB debugging" option on my phone.
https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#mous...
#!/bin/bash
# Update: January 2, 2021
#
# script to permit an end user to mirror an android device's GUI
# on a Linux GUI desktop in a window of its own with
# mouse and keyboard interactivity
#
# Prerequisites:
#
# android device with adb debugging enabled
# adb (i.e. android-tools-adb)
# scrcpy (android screen mirror tool)
# USB connection between Android phone and Linux machine
#
# Setup:
#
# Log in as root and do the following:
#
# 1. use visudo to create or edit the file /etc/sudoers.d/adbmount
# with the following entries (use suitable paths to
# the binaries) to authorize the end user for fuser
# and adb use:
#
# %users ALL=(myth) NOPASSWD: /bin/fuser
# %users ALL=(myth) NOPASSWD: /bin/adb
#
# 2. create a new group or add an entry in /etc/group
# for "plugdev" with the end user as member, such as:
#
# plugdev:x:46:mythical
#
# 3. connect the android device to the Linux machine via
# a USB cable and use the lsusb command to get the
# android device's identifying info, such as:
#
# Bus 001 Device 012: ID 18d1:XXXX Google Inc.
#
# 4. create the file /etc/udev/rules.d/51-adbmount.rules
# with the following line, using the id from step 3:
#
# SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="XXXX", MODE="0666", GROUP="plugdev"
#
# 5. run the following command to load the new rules so
# that udev will now allow members of group "plugdev"
# to access the android device:
#
# udevadm control --reload-rules
#
# 6. test this script as the specified end user instead
# of as root
# first kill any hanging adb tcp port 27183:
sudo /bin/fuser -k -n tcp 27183 2>/dev/null
# force any running adb server process to stop:
sudo /bin/adb kill-server 2>/dev/null
# force the adb server to start and scan USB bus:
sudo /bin/adb devices
# start the scrpy app:
/bin/scrcpyThe unicode support when injecting through keyboard is also pending for years. Looking forward to getting support from other PR.
> This application provides display and control of Android devices connected via USB (or over TCP/IP). It does not require any root access. It works on GNU/Linux, Windows and macOS.
Nice job self-promoting though, almost didn't notice.