All Discussions
  • General
  • The Pro Guide to SCRCPY

Started by Biden2020prez · Jan 12, 2023
Biden2020prez

I was reading through the SCRCPY documentation today, and learned many cool things. I thought it might be helpful to make a guide for everyone in case others are interested.

Lets get started.

Prerequisites:

  • This guide is made using a windows computer. This will work on Linux and Mac but you'll need to Download the correct version of SCRCPY and any other OS may have other Prerequisites.
  • Android phone with API 21 or above (android 5 or above), with USB Debugging enabled
  • SCRCPY for Windows 32-bit - - - 64-bit (If you're not sure, you can try both šŸ™‚)

Connect a Device
Make sure all prerequisites are met, then plug your phone into the computer. Extract the Scrcpy Zip. Navigate to the extracted directory and open the scrcpy.exe file. It should open a application that shows your phone's screen. You can control it with your mouse and keyboard.

Not working? In the Scrcpy Directory, open the open_a_terminal_here.bat file, and type Scrcpy into the command prompt. Either it will work and allow you to control the phone, or it will fail and give an error message. Now you try to debug the issue.

Connect Wirelessly
You can connect to a device wirelessly using SCRCPY. On android 11+, you can do this without a computer, but on A10 and lower, you need to use first connect with a USB cable. In either case you can only remotely control your phone if both devices are connected to the same WiFi.

  • Android 10 and lower:
    Connect your phone to USB debugging, open the open_a_terminal_here.bat file, and run the command scrcpy --tcpip. Now a screen should open up where you can control your phone. Now uplug your phone, and continue controlling it! Isn't it cool? To stop the connection, just press ctrl + c in the console (cmd prompt). To restart it (without reconnecting your phone), just run scrcpy. To fully disconnect, run adb kill-server. Note: After you turn off the phone, you will need to connect to a computer again to get a wireless connection.

  • Android 11+ (two options)
    -1. Use the method for older phones. (It can be easier sometimes).
    -2. Go to settings > About phone: and somewhere here you will find your IP address. look for the 192.168.....
    Then run scrcpy --tcpip={ip.add.ress}. Replace it with your actual IP.
    Example: scrcpy --tcpip=192.168.1.1

Screen Recording
Scrcpy has an amazing feature to record your screen from your computer. just run scrcpy --record=file.mp4. Replace file.mp4 with the filename that you want. Stop the recording by pressing ctrl + c in the console.

OTG Mode / No video Codecs!
This is something I was excited to figure out. I saw this on Apps4Flip odds N' Ends page, and didn't think much about it:

Please note 4G flip phones which do not contain video codecs such as the Kyocera Cadance will not work with SCRCPY.

But I recently got A Schok Classic Flip which has no video Codecs. And... I couldn't SCRCPY it. So I used Virtual Flip. Great job @sh7411usa on this tool, but... It's relatively slow on updating the screen, which makes it tough to use. Luckily, I had a bluetooth mouse which I connected to my phone and it solved the problem. But if you don't have one? Use SCRCPY. Enough with the introduction...

To put a mouse on your screen with SCRCPY, just run scrcpy --otg. (If SCRCPY hijacked your computers mouse, press alt. You'll know what I mean once you try.). This doesn't mirror your phones screen to the computer, but does put a mouse on your phone which you can control with your computer's mouse.

Install APK
To install an APK, just drag the file to SCRCPY while it's open. One member told me he uses it sometimes to install 10 APK's at once by dragging them all to SCRCPY.

Push Files
To transfer (a) file(s) from your PC to your phone, just drag the file(s) to the SCRCPY screen. It will send them to the Downloads folder.

Clipboard Synchronization
When you copy on your computer using ctrl + c it copies to the phones keyboard. And vice versa.

Scrcpying the outer screen!!!
This is absolutely useless, but... Scrcpy can also mirror the outer screen of your phone. Usually the command for this is scrcpy --display=1. But if you are not sure run scrcpy --display=4334 and it will tell you what your options are.


Everything in this guide is taken from the Scrcpy official documentation. There are many things not included in this guide. some examples include: keeping phone screen off but Scrcpy on, making Scrcpy always on top on you computer, open Scrcpy automatically when phone is connected, read only mode, only keyboard or mouse but not both, lock orientation, and much more. I tried to select some of the useful and exciting few. If there is enough interest I may update this guide.

Techgen

Biden2020prez Great breakdown!
I just wanted to clarify things I've noticed about the copy clipboard functions. The way it works by me is pressing ctrl+c on scrcpy will copy the phones clipboard so for example if you wanted to copy text from the phone you would need to first press copy on the phone to get the text to the phones clipboard and then ctrl+c to copy it from the clipboard so you can paste it to the computer. Also, (at least the way it works on my phone sonim xp3) when pasting text from the computer onto the phone, it works more like adb input of letters, it types it on one letter at a time (pretty fast) and if there are numbers, and my keyboard is not on number mode, it will act as if I pressed those numbers on my keypad and put in whatever letters are there instead. I also noticed I can't paste a large amount of text, it always seems to stop after some limit. If you have a different experience on another phone, let me know.

FliphoneBochur

Biden2020prez One member told me he uses it sometimes to install 10 APK's at once by dragging them all to SCRCPY.

THIS IS GREAT! I never knew this feature existed!

In theory, would this work to install an XAPK file (by extracting it onto all the APK files, and then pushing them all at once)?

Techgen

FliphoneBochur I don't think so, it definitely doesn't work for the xapk whole, and I don't think it installs the separate apks as one (you can try). You'll also still run into the problem of how to modify it (if you're using a phone that doesn't need to be modified you can install using the install-multiple command)

FliphoneBochur

Techgen What if I modify each one? Will install-multiple still work? Will it only show up as one app in the menu? (I’m asking for the updated 24Six)

Techgen

FliphoneBochur This is a little out of place for this thread, but I don't think anyone successfully modified all the little apks inside an xapk, because it's not a full app

Biden2020prez

Techgen I think its different on different phones for some reason.

This is how it behaves for me as I am writing this reply (Qin F21 Pro):

  • When I copy the phones clipboard (from the phone itself), it automatically copies to the computer.
  • When I copy the computers text it Does Not automatically copy to the phone.
  • When I copy from computers text and open open scrcpy and ctrl v, it types it on the phone (automatically, not one by one), and ALSO copies it to the phones clipboard.
  • When I type numbers on the computer, it works the same as it does for you (eg: "5" will type = the letter j).
  • Alt + Shift + v types the letters one by one.

The difference is if I copy 123 on my computer. If

  1. I press Ctrl + V, it copies 123 on the phone (I think it copies it to the phones clipboard than pastes the phones clipboard)
  2. I press alt + shift + v, then it types it in T9 (which shows as the word "be" in the F21 Pro.


Running scrcpy --legacy-paste makes ctrl v act the same as alt shift v, and it types the letters one by one. Possibly SCRCPY does this automatically for you because your phones clipboard doesn't work nicely progrommatically. (Scrcpy also includes that feature for apps like termux which act weird for copy paste).

Running scrcpy --otg --hid-keyboard makes the phones keyboard crash when I type numbers (but works fine when I type letters). After it crashes, numbers and letters work beautifully through scrcpy (not sure why it works, bc scrcpy is supposed to only send keycodes on that mode....).



I think that's the full Sugya in terms of keyboard. Maybe I'll try on some other phones...

Techgen

Biden2020prez Interesting, it seems like I have legacy paste, it could be its the phone, or maybe I have an old version of scrcpy, I have it for a long time and never updated it.
UPDATE: I just downloaded a new version of scrcpy, and the paste works like you described. Definitely an improvement, there are still some other differences in trying to work out, thanks!

Flippy

Not sure exactly how my copy/paste works, but I did notice that it can be finicky sometimes, so I just play around till it works for me, but it is wonderful for copy/pasting APN's for those phones that need it. Saves a whole lot of work.

On another note, when I try to use Virtual Flip on Kyocera Cadence, It only barely works, and I usually get errors. Any way to fix this? Mouse would be a nice idea, but cant help if I have a phone with a broken screen....

Biden2020prez

Flippy You wont really be able to mirror your screen because the phone will have encoding error. I don't see any solution better than virtualflip, except a version of VirtualFlip that takes screenshots faster... which doesn't exist

Biden2020prez `

Regarding the schok classic would there be a way to add the neccesary video codecs, (it does support video playback, unlike the kyoceras) to allow scrpy and Android auto as well?

Biden2020prez

hocker I cannot say for sure that's why Android Auto doesn't work. Just a guess. In terms of SCRCPY, I have no clue how codecs work, but I am guessing it's not possible.