How to Display Android Screen on Ubuntu 20.04
Displaying the Android screen on a computer is usually done for application demos, I need it to make a tutorial.
0.Configuration on Android
First activate the Developer Options feature on an Android phone. To activate it, go to Settings -> About phone -> Android version. Tap Android version 7 times.
Then come back and go back to Settings, already active Developer optons menu. I am using Redmi Note 8 with Android 9 (MIUI 11), the menu Developer options is located at Settings -> Additional settings.
Under Developer options, enable USB debugging.
1.Install adb
Install adb and fastboot on Ubuntu 20.04.
1 | sudo apt install android-tools-adb android-tools-fastboot |
2.Install scrcpy
To display the Android screen on Ubuntu uses a utility application called scrcpy developed by Genymobile, the same company that developed Genymotion Android emulator.
1 | sudo apt install scrcpy |
3.Connect Android to Ubuntu
The next step is to connect your Android phone to Ubuntu using a USB cable.
4.Run scrcpy
After that run scrcpy through the terminal.
1 | scrcpy |
If successful, the scrcpy application window will open and display the Android screen.
5.Connection via Wireless Network
Displaying the Android screen on Ubuntu can also be connected via a wireless network connection. Connect the USB cable first, then run the command adb.
Enable tcpip on Android phone and open port 5555.
1 | adb tcpip 5555 |
After that unplug the USB cable, then run adb again to connect via the IP address of the Android phone.
1 | adb connect IP_ADDRESS_ANDROID:5555 |
After that, run scrcpy again. The Android phone screen has appeared on Ubuntu via a wireless network.
6.Multiple Android Screens
scrcpy can display multiple Android phone screens at once.
Show all connected Android devices.
1 | adb devices |
Example of the results of the above command.
1 2 3 | List of devices attached DEQKN9TNJ device 192.168.1.8:5555 device |
Then run scrcpy followed by the serial number of the device.
Displays the screen of the Android phone connected with a USB cable.
1 | scrcpy -s DEQKN9TNJ |
Displays the screen of an Android phone connected to a wireless network.
1 | scrcpy -s 192.168.1.8:5555 |
7.Record Screen
scrcpy supports a feature to record the screen and save it in mp4 or mkv format.
1 | scrcpy -r record.mp4 |
If you found this article helpful and would like to support my work, consider making a donation through PayPal. Your support helps me continue creating useful content and tutorials. Thank you!
Donate via PayPal: https://paypal.me/musaamin