scrcpy_android_phone

Add Subtitle here

Introduction

Recording YouTube videos with your phone can be tricky, especially when you need to make sure everything is perfectly in focus. Constantly checking your phone screen is a hassle. A great solution is to mirror your phone screen to your PC. This way, you can see exactly what your phone is recording in real-time, making it easier to adjust and get the perfect shot.

In this tutorial, I’ll show you how to wirelessly mirror your Android phone’s screen to your Linux PC using scrcpy and adb. By the end, you’ll be able to monitor and control your phone’s camera from your computer, making your video recording process smoother and more efficient. Let’s get started!

Installation

Step 1: Install ADB (Android Debug Bridge)

ADB is a command-line tool that allows you to communicate with your Android device.

here is and installation commands for several linux distributions:

  • For Ubuntu/Debian/Raspberry Pi:
sudo apt update
sudo apt install adb
  • For Fedora:
sudo dnf install android-tools
  • For ArchLinux/Manjaro
sudo pacman -Syu android-tools

Step 2: Install Scrcpy

scrcpy is a tool to display and control Android devices connected via USB (or over TCP/IP). It does not require any root access.

For Ubuntu/Debian:

sudo apt install scrcpy

For Fedora:

sudo dnf install scrcpy

Alternatively, you can install scrcpy via Snap:

sudo snap install scrcpy

Step 3: Enable USB Debugging on Your Android Device

On your android device, do the following steps, to enable USB Debugging

  1. Open the Settings app.
  2. Scroll down and select About phone.
  3. Tap Build number seven times to unlock Developer Options. You may need to enter your device’s password.
  4. Go back to Settings and select System or Advanced (depending on your Android version).
  5. Tap Developer options.
  6. Enable USB debugging.

Step 4: Connect Your Android Device to Your Linux PC

Use a USB cable to connect your Android device to your Linux PC. Make sure to allow USB debugging permission on your Android device when prompted.

Step 5: Verify ADB Connection

Open a terminal on your Linux PC and run:

adb devices

You should see a list of connected devices. If your device is listed, it means ADB can recognize it.

Step 6: Start Scrcpy

In the same terminal, start scrcpy by simply typing:

scrcpy

Your Android screen should now be mirrored on your Linux PC.

Additional Options

scrcpy has several options you can use to customize its behavior:

Change the resolution:

scrcpy -m 1024

This command limits the width and height of the device screen to 1024 pixels (the aspect ratio is preserved).

Fullscreen mode:

scrcpy -f

Record screen while mirroring:

scrcpy --record file.mp4

Connect wirelessly:

Connect your device via USB and enable TCP/IP mode:

adb tcpip 5555
  • Disconnect the USB cable.
  • Find the IP address of your Android device (you can find this in the Wi-Fi settings).
  • Connect to the device using its IP address:
adb connect DEVICE_IP:5555
  • Start scrcpy:
scrcpy

This method allows you to mirror and control your Android device over Wi-Fi.

Troubleshooting Tips

Device not detected: Ensure USB debugging is enabled and authorized on your Android device. Try using a different USB cable or port. Lag or low performance: Lower the resolution using the -m option. Ensure both your PC and Android device are not under heavy load. By following these steps, you should be able to successfully mirror and control your Android device on your Linux PC using scrcpy and adb.

Connect Wirelessly without USB Cable

Although USB cables are Abundant, but it happen sometimes you don’t have one in hand, so here will explain how to make a connection between android phone and PC with no USB cable.

Step 1: Enable USB Debugging and Wireless Debugging on Your Android Device

On your phone you need te enable wireless debug mode.

  • On Your Android Phone Open the Settings.
  • Scroll down and select About phone.
  • Tap Build number seven times to unlock Developer Options. You may need to enter your device’s password.
  • Go back to Settings and select System or Advanced (depending on your Android version).
  • Tap Developer options.
  • Enable Wireless debugging.

Step 2: Connect Your Android Device to Your Wi-Fi Network

Ensure your Android device is connected to the same Wi-Fi network as your Linux PC.

Step 3: Pair Your Device for Wireless Debugging

  • Open a terminal on your Linux PC and run:
adb pair DEVICE_IP:PORT

Replace DEVICE_IP with the IP address of your Android device and PORT with the pairing port shown on your device screen under Wireless debugging settings.

On your Android device, confirm the pairing request.

Step 4: Connect to Your Device Wirelessly

After pairing, connect to your device using:

adb connect DEVICE_IP:5555

Replace DEVICE_IP with the IP address of your Android device. The default port for ADB is 5555.

You can check if the device is connected by running:

adb devices

You should see your device listed as connected.

Step 5: Start Scrcpy

In the same terminal, start scrcpy by simply typing:

scrcpy

Your Android screen should now be mirrored on your Linux PC.

Troubleshooting Tips

Device not detected:

  • Ensure wireless debugging is enabled and authorized on your Android device.
  • Ensure both your PC and Android device are on the same Wi-Fi network.

Lag or low performance:

  • Lower the resolution using the -m option. Ensure both your PC and Android device are not under heavy load.

By following these steps, you should be able to successfully mirror and control your Android device on your Linux PC using scrcpy and adb over a wireless connection.