Scrcpy is an open-source tool that allows you to display and control Android devices connected via USB or TCP/IP. It does not require any root access and works on GNU/Linux, Windows, and macOS. It is low latency, high performance, and provides quality screen mirroring. It also supports copy-pasting and real-time interaction with the device using your keyboard and mouse.
First, you need to enable USB debugging on your Android device. You can do this by going to the Developer Options in your device's settings. If you don't see Developer Options, go to About Phone -> Software Information and then tap on the Build Number seven times to enable it.
Connect your Android device to your Ubuntu PC using a USB cable.
On your Ubuntu PC, open a terminal and install Scrcpy. You can do this by typing the following commands:
sudo apt update
sudo apt install scrcpy
Once Scrcpy is installed, you can start mirroring your Android device by typing scrcpy in the terminal. If your device asks for debugging permission, make sure to allow it.
If you want to connect wirelessly, you need to connect your device initially via USB, then run the following command in the terminal:
adb tcpip 5555
adb connect DEVICE_IP:5555
Replace DEVICE_IP with your Android device's IP address. After running these commands, you can disconnect the USB cable and run scrcpy as usual.
Please note that the performance may vary depending on your device and network conditions.