Use Scrcpy to Mirror and Control Android on Linux
Scrcpy (last transaction as Display purge Photocopy) is an amenable-resource execution you can consumption to effortlessly regulate and also mirror your Android contraption on Linux. You can attach to your Android contraption via USB cable television or wirelessly and also regulate it making capitalize of your keyboard and also mouse. Here we manifest you how to regulate your Android contraption on Linux.
- Why You Telephone call for Scrcpy in Linux
- Services of Scrcpy
- Mounting Scrcpy in Linux
- Tying to Your Android via USB Wire
- Tying to Your Android via Wireless Relationship
- Scrcpy Utilization Instances
- Exterminating Scrcpy from Linux
Why You Telephone call for Scrcpy in Linux
You may be assuming, out of all display-sharing implementations and also Android mirroring implementations, why carry out you need Scrcpy on your Linux contraption? The counterclaim is humble: Scrcpy doesn’t need you to installed any app on your phone phone neither implements it need origin accessibility to your contraption. Alternatively, it’s an amenable-resource, light-weight, and also high-practicality command-jabber upwards tool, rendering it flawless for any person peeking to mirror and also regulate their Android contraption on a Linux contraption while gaining the leeway of scripting and also modification.
Additionally, it permits you to record your Android display video clip and also audio with multitudinous modification options such as bitrate and also resolution, rendering it flawless for making tutorials or apprehending gameplay.
Note: To consumption Scrcpy, you have to have at least Android iteration 5.
Services of Scrcpy
Here are some of the flawless centers of Scrcpy:
- Doesn’t need the internet and also a individual account
- Permits you to record your contraption display
- Mirror Android with high-attribute (1920×1080 or above) and also low latency (35~70ms)
- Maintains audio forwarding (Android 11+)
- Permits you to consumption the clipboard in the bi-guideline
- Maintains OpenGL and also OTG mode
- Permits mirroring Android as a webcam
- Maintains web digital camera mirroring (Android 12+)
- Accessible for Linux, Windows, and also macOS
- Physical keyboard and also mouse simulation
- Permits you to consumption your phone phone while its display is off
- Permits you to crop the Android contraption display while mirroring
- Maintains mirroring unlike equipments at the same time
Scrcpy in a similar way possesses unlike unlike other intriguing centers. You can dissect all these centers by experimenting with this power.
Mounting Scrcpy in Linux
In yesteryear installing Scrcpy, you have to installed adb (Android Debug Bridge) in your contraption. For this purpose, execute one of the consequent commands, relying on your distro:
# Debian-based system sudo apt install adb # Fedora-based system sudo yum install adb # Arch-based system sudo pacman -S android-tools

After installing adb, installed the secure iteration of Scrcpy:
# Debian-based system sudo apt install scrcpy # Fedora-based system sudo dnf copr enable zeno/scrcpy && dnf install scrcpy # Arch-based system sudo pacman -S scrcpy

You can in a similar way installed the secure iteration of Scrcy making capitalize of snap:
sudo snap install scrcpy

After the successful installation, you can confirm its iteration making capitalize of the scrcpy -v
command:
scrcpy -v

Place the the majority of recent iteration of Scrcpy for added centers
If you need centers prefer audio forwarding and also web digital camera mirroring, you have to installed the the majority of recent iteration of Scrcpy (presently it’s iteration 2.4).
For this purpose, you have to installed it via its resource code.
First of all, make certain that your contraption possesses all the necessary dependences:
# Debian-based system sudo apt install ffmpeg libsdl2-2.0-0 adb wget gcc git pkg-config meson ninja-build libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev

Then, duplicate the Scrcpy documents source making capitalize of the git clone
command:
git clone https://github.com/Genymobile/scrcpy

Next, browse to its catalog and also sprinted the Scrcpy installation script:
cd scrcpy ./install_release.sh

This way, the the majority of recent iteration of Scrcpy will unquestionably be installed in your Linux contraption. To confirm it, execute the consequent command:
scrcpy -v
Now, you’re all kit to attach with your Android contraption via USB or wirelessly.
Tying to Your Android via USB Wire
To attach to your Android contraption, you have to enable Developer options and also USB debugging.
For this, head to your contraption Postures -> Product serviceability:

Open the Around phone phone serviceability and also click on the Construct number unlike times until you fetch a message proverb “You are a creator“:

Next, head ago to Product settings and also right here you’ll be able to see Developer options. In the Developer options, enable the USB debugging serviceability:

After permitting the USB debugging serviceability, you’ll furnish consumption a rile authenticating your substitute. Here, press the OK button:

Now, attach your phone phone to your Linux contraption with a USB cable television. After lugging out this, you’ll note a USB debugging mode notification on your Android.
Next, amenable the incurable in your Linux contraption and also execute the scrcpy
command to mirror your contraption:
scrcpy

Particularly, you can see your Android mirroring on your contraption.
To disassociate your phone phone, merely press the Ctrl + C fulcrum.
Tying to Your Android via Wireless Relationship
You can in a similar way attach your Android contraption wirelessly. First, attach your phone phone to Linux via a USB cable television and also execute the consequent adb
command to see Linux realizes your Android contraption:
adb devices
Situate out the IP address of your Android:
adb shell ip route

Keep in mind: Your Linux and also Android have to be attached to the really same Wi-Fi relation.
You can in a similar way check the IP address of your phone phone by going to its Postures -> Wireless & network -> Wi-Fi serviceability and also nagging the Configure button:

After granting your phone phone’s IP address, you’ve to configure a port for your TCP/IP relation. For instance, I kit it to 5000:
adb tcpip 5000
Note: You can configure any unassigned port.
Now, disassociate your phone phone from the USB cable television. Then, attach your phone phone to your Linux contraption making capitalize of its IP address and also the enumerated TCP/IP port over a network:
sudo adb connect 192.168.1.121:5000

In sheath of unlike equipments, you can consumption the serial number of your Android to attach to it over a network:
scrcpy -S <serial-number>
Lastly, execute the scrcpy
command to regulate and also mirror your Android:
scrcpy

As enumerated previously, you can disassociate this relation by nagging Ctrl + C fulcrum.
Scrcpy Utilization Instances
Let’s dissect some examples of the Scrcpy command to recognize how it jobs.
Adjust Window Title
You can readjust the title of the dwelling window showing your Android by making capitalize of the --window-title
flag in the scrcpy
command:
scrcpy --window-title=‘Make Tech Easier'

Document Android Display purge
You can record the display of your Android by making capitalize of the -r
or --record
flag. For instance, you can record your contraption display and also preserve it in a newfangled record named “maketecheasier.mp4“:
scrcpy --record maketecheasier.mp4

You can in a similar way fuse the -r
flag with the -N
flag, which methodologies unquestionably no brandish. This way, your Android display will unquestionably not manifest upwards on Linux. However, the entire display will unquestionably still be recorded to a record:
scrcpy -Nr MTE.mp4

Tailor Window Display purge
Alternatively, you can kit the optimum dimension (width and also top) of your dwelling window making capitalize of the -m
or --max-size
serviceability:
scrcpy -m 950

You can even limitation the mirror to read-lone mode by making capitalize of the -n
or --no-control
flag. This way, you’ll be able to lone sight your Android display on Linux:
scrcpy --no-control
Alternatively, you can limitation the display squeeze framerate making capitalize of the --max-fps
flag in the Scrcpy command:
scrcpy --max-fps=50
Scrcpy in a similar way sectors a --show-touches
flag, which makes it possible for you to see the physical touches of the contraption in real-time on your Linux:
scrcpy --show-touches
You can consumption the -S
flag of the Scrcpy command to lock your contraption and also still be able to regulate it. This flag help preserve the power of your Android:
scrcpy -S
Lastly, you can consumption the --rotation
flag to kit the initial brandish rotation. The default trait is 0. However, the conceivable top foibles are 0, 1, 2, and also 3, with each trait containing 90 levels of rotation counterclockwise:
scrcpy --rotation=3

Scrcpy sectors multitudinous unlike other valuable options, you have to dissect and also hazard them out.
Exterminating Scrcpy from Linux
You can execute any of the consequent commands to uninstall Scrcpy from your contraption relying on your installation approach:
# Debian-based system sudo apt remove scrcpy # Fedora-based system sudo dnf remove scrcpy # Arch-based system sudo pacman -R scrcpy # snap sudo snap remove scrcpy # Latest version via source code sudo ninja -Cbuild-auto uninstall

This way, you’ve sufficiently out-of-the-way Scrcpy from your contraption. In sheath you don’t prefer Scrcpy you can hazard unlike other Android mirroring apps to regulate your contraption from your Linux contraption.
Image credit scores: Nimrach Chaudhry. With one voice modifications and also screenshots by Nimrah Chaudhry.