Scrcpy (Screen Copy) is a great tool. At its most basic, it is a way to interact with an Android device from our PC. We can run apps, control cameras, and play games with our Android device, but via a USB or Wi-Fi connection. We first came across Scrcpy in 2020 and use it as a way to add a second, high-quality camera to an OBS setup.
This camera is actually a four year old mobile and we display our Android desktop as an application window on our desktop. We can even use Scrcpy over a Wi-Fi connection, which is useful for mobile video streams. If you have an old Android cell phone or tablet in a drawer, scrcpy is the way to breathe new life into it and repurpose it as part of your broadcast setup.
Android developers will appreciate Scrcpy’s advanced features to record video from broadcasts and show where the user is connected. These two features can be used to debug errors in applications.
In this method, we will learn how to setup scrcpy on Windows, and learn more of its advanced commands.
scrcpy إعداد setup
Scrcpy is remarkably easy to set up. On Windows, all we need to do is download one archive and we’re ready to go.
1. On your Android device, go to Settings >> About Phone.
2. Scroll down to Build Number and tap on it seven times. This will open developer mode.
3. Click again and search for USB.
4. Scroll down to And the Activate flash tracking.
5. Connect your Android device to your computer using a USB cord.
6. Download Pre-built archive for Windows. Linux and macOS users will need to follow FAQ for their operating system.
7. Extract the archive to a folder on your desktop.
8. Open Command Prompt And the Go to the folder on your desktop.
9. Run the scrcpy.exe command. If prompted, allow the connection on your Android device.
We now have a basic two-way communication between our PC and Android device. The window represents our Android device, and we can see and interact with the device as if it was in our hands. We can use our mouse to scroll and interact with apps and keyboard to enter text.
Close the connection by closing the application window. Let’s discover more features of scrcpy.
Application window scaling
The application window, the screen of our Android device, can be scaled with the max-size argument. Our scenario is that we want to expand the size of the application window to be used in the video. We don’t want the window to dominate the screen with the Android device window.
Run scrcpy from the command prompt and use the -m argument to set the maximum size to 1024. The -m argument is short for –max_size and both can be used.
scrcpy.exe -m 1024
lock screen rotation
By default, scrcpy will run without screen rotation lock. This means that when you rotate your Android device, the application window will react accordingly. This may not be the desired effect, thus we can lock the rotation. We may want to use the device in landscape mode as a camera in a complex OBS setup, or we may want to run Candy Crush in portrait mode.
Via Command Prompt, open scrcpy with one of the following options to lock rotation.
scrcpy --lock-video-orientation # initial (current) orientation scrcpy --lock-video-orientation=0 # natural orientation scrcpy --lock-video-orientation=1 # 90° counterclockwise scrcpy --lock-video-orientation=2 # 180° scrcpy --lock-video-orientation=3 # 90° clockwise
Android device registration
Android interface recording can be a useful tool. If you want to record the steps to complete a task, raise an error or add the video to a YouTube tutorial, screen recording via scrcpy is rather useful.
For screen recording, we use the -r argument, along with the name of the output file.
From the command prompt, set scrcpy to record the video stream to a file called demo.mp4.
scrcpy.exe -r demo.mp4
We can mix the previous arguments to rotate the screen and adjust the screen size. In this case, we will rotate the screen to landscape mode, set the screen size to a maximum height of 1080p, and save the video to the 1080.mp4 demo.
scrcpy.exe --lock-video-orientation=1 -m 1080 -r demo-1080.mp4
Connect via Wi-Fi
USB provides the best stable connection to our Android device, but there are times when a wireless connection is the best option. For example, if you want to add a wireless camera to broadcast OBS, or record your game from the comfort of your couch. The –tcpip argument is key to this step.
1. Make sure your Android device is connected via USB. For the first connection, we need to use USB to set up the connection properly.
2. Make sure that your Android device is connected to the same network as your computer.
3. Run scrcpy with the –tcpip . argument To detect your Android device and automatically connect over the network.
4. Remove the USB connection and the application window will remain on the screen, enabling us to use the device over Wi-Fi. Note that there will be a slightly longer delay between action and reaction due to network latency.
Window Configuration Options
The scrcpy application window has its own configuration options that we can use to modify the application according to our needs.
We can give the window a title using the –window-title argument. In this example, we set the window size to a height of 768 pixels.
scrcpy --window-title 'Tutorial’
Adjust window position and size
If you want the application window to be in a specific location, this can be specified with an argument when running scrcpy from the command prompt.
scrcpy --window-x 100 --window-y 100 --window-width 800 --window-height 600
Unlimited application window
If you don’t want or need window decorations (minimize, maximize, and close), this argument will hide them. Note that you will need to press CTRL + C at the command prompt to close the window.
always on top
This argument will ensure that the Android device’s scrcpy window is always on top of every other window/application.
To set scrcpy to use all available screen, use the -fullscreen argument, shortened to -f. You will need to ALT-TAB and press CTRL + C at the command prompt to close the session.
scrcpy --fullscreen scrcpy -f # short version
This useful argument will make it clear where the user is pressing the screen. The argument can be called with a full option, verbose, or a shortened version.
scrcpy --show-touches scrcpy -t