linux worries about Kirin Ubuntu scrcpy Ando mobile phone with the same screen

In fact, it’s very simple. You only need to install one application scrcpy (that is, copy screen copy) in Worry Kylin. You don’t need to install ADB.
First, turn on the debugging mode on your phone. USB link. Select file transfer. If your computer has Bluetooth (I think it needs to support two-way transmission) ) It is also possible to synchronize mobile phone sounds.
Kylin’s Bluetooth management is still very easy to use. The mobile phone turns on Bluetooth, searches for the phone on the computer, and then connects to the computer and then informs the information point to
agree. Then the phone’s voice can be synchronized with the computer output
CTRL+ALT+T Open the terminal and enter the following installation command
(you need to open the development mode on your mobile phone, you will know about it by Baidu)

sudo apt install scrcpy

After the mobile phone and the computer are connected, open the terminal terminal and enter scrcpy and press Enter. The effect is to watch the video. The full screen will be converted to a horizontal screen.
The effect of watching video on mobile phone
Create a startup file so that you don't need to run it in the terminal. Open the terminal first.
Pluma is a built-in text editor. The previous command is to create a scrcpy startup file with the text editor that comes with Eukylin

pluma ~/桌面/scrcpy.desktop

The content of scrcpy.desktop is directly copied to the opened text editor as follows, click to save and close the editor, right-click on the desktop, and scrcpy.desktop properties can execute all tick

[Desktop Entry]
Name=scrcpyXsleep
Name[zh_CN]=手机同屏
Terminal=false
Type=Application
Categories=Graphics;
StartupNotify=false
Actions=Configure;Capture;
#Exec=/home/用户名/文档/scrcpysleep.sh
Exec=scrcpy
Icon=utilities-terminal

Create a script and put it in the startup to achieve the same screen when you plug in your phone (you need to open the development mode on your phone, you will know about it in Baidu)

pluma ~/桌面/scrcpysleep.sh

Copy the following content in the open text editor, save and close, the scrcpysleep.sh script will be created on the desktop. You can right-click the file attribute and tick the box after it is executable.

#!/bin/bash
while [ true ]; do
#间隔5秒运行一次
/bin/sleep 5
scrcpy
done

The preliminary work has all ended. Back to the terminal

mkdir -p $HOME/.config/autostart
chmod -R 755  ~/桌面/scrcpy.desktop
chmod -R 755  ~/桌面/scrcpysleep.sh
cp -r ~/桌面/scrcpy.desktop $HOME/.config/autostart
sudo cp -r ~/桌面/scrcpysleep.sh /bin

End of work

Guess you like

Origin blog.csdn.net/lcs910102814/article/details/106290136