Having issues getting scrcpy to work properly in my newbe Zorin Core installation

Hardware: MSI GF65 Thin laptop with 64GB RAM, 2x 1TB NVMe, RTX2060 w/6GB
Operating System: Zorin 17.1 CORE upgraded to 17.2

The SNAP 1.25 version of scrcpy installs, appears to run and I can see my Android screens, but cannot interact either with the mouse or keyboard. My Samsung Galaxy S22 is setup with USB Debugging via the Developer Options and prior to switching over to Zorin from Windows 10, scrcpy worked fine. I've been using and supporting Windows since the late 80s, and while I've periodically played with Linux distributions over the decades, I never got into them so I'm pretty much a newbie. I've uninstalled, reinstalled it, as well as tried the 1.27 version on Snap, but that one won't even launch. I've searched this forum, others, and even tried to follow the instructions on Genymobile's Github to install the newer version, but it errors when trying to install ffmeg. Any step by steps in further troubleshooting and ways to fix 1.25 or installing the Github version would be very welcomed. If you need further information, please let me know, but I know very little about the terminal commands needed. Thanks in advanced for anyone who is willing to help.

Hi, welcome to the forums.

In Linux, there are a few package formats that work in isolation from the rest of the system, one of them being Snap. As everything else, this has some advantages but also some disadvantages. One of them being that sometimes there are permission issues like this where certain features within the system cannot be accessed correctly.

My guess is that this is the issue you are experiencing. I would recommend uninstalling the package and install it again through the command line, which would install the native package format used by Zorin OS. It'll be at a lower version, 1.21, but that's to be expected (and a whole other discussion).

On the terminal, you can run:

sudo apt update
sudo apt install scrcpy

This will not install a graphical interface; you have to run it through the terminal as well. First, plug in your device (after making sure that USB debugging is enabled, etc), and run with:

scrcpy

It should detect things automatically:

I know is not as ergonomic this way, but we can take a look at making it run in a nice GUI later.

zenzen, thank you for taking the time and trying to help me with my issue. I really, really appreciate it. I've tried to follow your instructions and I've included some screen shots to show, what I'm seeing after installing it using: sudo apt update, then sudo apt scrcpy. From my limited understanding it appears to have been installed, but when I try to run it, it just tell echos back: scrcpy 1.21 https://github.com/Genymobile/scrcpy and nothing else happens. Also have included my Android Developer options screen shot too, to show I have it set correctly. I'm just using USB not wireless.



Does scrcpy have a nice gui??? Not that I am doubting anyone, but I've used this for years on Windows and the (easiest) way to install it there is, get the zip from the repo (the only official source), extract it, and open Command Prompt in the folder it was extracted to and run your commands there.

So for Zorin I naturally went to the repo to get it and followed the instructions for Linux. Basically, dl the dependecies, clone the repo, run the install script. It runs with no problems and I have no problems controlling with mouse/keyboard. Also my version is 2.7

Try that if you can. I really never would have thought to search for scrcpy in any sort of store and I've never had problems with it.

EDIT: to add with the Linux version I can use the scrcpy commands from Terminal anywhere, not just in a specific folder.

j_luz thanks for the suggestion, but like I said, in my initial post I tried to follow the instructions on Genymobile's Github to install the newer version, they didn't work for me. I've included a screen shot of the error message. Perhaps you could give me step-by-step instructions on how you were able to install it in Zorin 17.2. Thanks again for taking the time to help! I am very grateful for all of the help I can get.

Sorry buddy, I did see you mention something about following the repo instructions, but then I saw all the messages about sudo apting and I assumed you meant following the first instructions in the repo which deal with how to install scrcpy from your distro.

I didn't do anything special when I installed. I copied the dependencies command and ran it. Changed directory to ~/Repos and pasted/ran the git clone command. Cd into scrcpy directory that made and pasted/ran the install script command.

Not sure if you want to try it again, @zenzen can probably figure out what's going on with the apt install quicker than I could troubleshoot this. I would just suggest trying to install the dependencies again, then cd into scrcpy and git pull, then run the install command again.

Is it suspicious that after uninstalling, you say scrcpy and the return is bash? When I type an unrecognized command Terminal just tells me something like:

Command 'hi' not found, but can be installed with:
sudo snap install hi

j_luz thanks for clarifying things. I've tried it several times today, but it still is unable to locate ffmeg or libavcode-dev so I'm assuming it doesn't skip them and try to locate and install the others. I also tried another version of scrcpy in the Software app, that was supposed to be v2.7-3 and when I launch it, nothing happens, and can't even find it in the terminal, so uninstalled that one too. I'm sure I'm doing something wrong even though I'm following the instructions listed in the Github to the letter. Hopefully someone will think of something I haven't tried or forgot to do and post a suggestion to try. Again, thanks j_luz for stopping by and trying to help.

Spelling mistake :smiley_cat:

2 Likes

Oh that's brilliant! Hopefully this will resolve the issues so @DarinM1967 can get scrcpy running.

On the off change that using the latest version doesn't work, did you see a message popping up on your phone asking to confirm the USB debugging session for this computer?

It should look something like this:

littlekun, thanks for pointing that out. I'm still new to how paste into the terminal since it doesn't take Ctrl+V, so I typed it out by hand and I guess I misspelled something. After figuring out how to right-click paste the instructions from the Git, it was able to install properly. I tested it and now scrcpy is working perfectly!!! YAY!!!

1 Like

Closing topic on a positive note. After littlekun noted my misspelling, and figuring out on my own how to paste into a Linux terminal from Git, I was able to compile and install the newest version of scrcpy for linux, launched, tested, and confirmed that the instructions on the Git for scrcpy will work in Zorin and that the newest version works correctly. Just need to figure out how to create a icon to launch it instead of having to keep opening a terminal to do it, then it will work just like it does in Windows 10. For any other Windows 10/11 linux newbies like myself its good to know that we have a place to get help with our questions here in Zorin's forum. Thanks again to zenzen, j_luz, and littlekun for all of the help, patience, and understanding.

1 Like

You may or may not find it simpler to use middle mouse to paste. Saves a click and mouse motion, which... frankly isn't a huge inconvenience if you like using the menu, but just FYI that middle mouse is a common paste method in Linux.

Belatedly, welcome to Zorin and the forum.

You can also use Ctrl+Shift+C to copy from the terminal (and the same with V to paste). The reason is that terminals were created before the infamous copy/paste shortcuts, and already have that shortcut mapped out to something else (sends a signal to whatever process is running to terminate it).

This is relatively easy to do, all you need is to create a new file with a .desktop extension that defines the new entry in the applications menu.

  1. Open the file manager and enable "Show hidden files", from the preference menu found at the top-right. You should see a bunch of files and directories that were previously hidden (notice they all start with a dot .).

  2. You can now navigate to .local -> share -> applications.

  3. Here, create a file named scrcpy.desktop, with the following contents:

    [Desktop Entry]
    Type=Application
    Name=scrcpy
    Comment=Launches Screen Copy (scrcpy) program
    Exec=/usr/bin/scrcpy
    Terminal=true
    Icon=scrcpy
    Keywords=Phone;Android;
    Categories=System;
    

    Feel free to add any keywords that you like. I'm using "phone" and "android" here just because it's a lot easier to type than "scrcpy", so you can use those to search for it later in the applications menu.

  4. Back in "Home", create a new folder called .icons. Since it starts with a dot, it will be hidden after you disable "Show hidden files", but it will be there.

  5. Download the official icon from the project's GitHub page.

  6. Move it to the newly created .icons folder, and rename to something more specific like "scrcpy". Whatever you want to call it, it should match the value of the Icon= stanza on the .desktop file.

  7. There should be a new entry in the applications menu under "System Tools", or searching using one of the keywords:

NOTE: It just so happens that scrcpy will exit immediately when it errors for whatever reason, like not being able to find a phone connected. This is fine, but keep in mind that creating this launcher will close the terminal window immediately, so you will only see a flashing window that closes far too quickly for you to see what went wrong. If you cannot get it to work after a few attempts, it's probably best to launch the terminal and run the command yourself.


Of course, another alternative is to install one of the graphical interfaces that are available... but I've checked them and they are all unmaintained at this point. This doesn't necessarily mean that they won't work, but they are not getting any more updates so I would advice not to use them.

As a special Welcome to Zorin, we can have @DarinM1967 create a new GUI for scrcpy! Now that he's learned to paste into Terminal there's no stopping him! (Took me at least a month to find out about the middle mouse button...)

1 Like

A rite of passage, love the idea! :fire:

1 Like

Locklear93, thanks for the information. I'll have to give it a try.

Zenzen, this is awesome! Thanks for both the key-shorts and for the extensive instructions for creating icons to launch programs that don't automatically load up in the menu. I have a couple now like The RangeEngine, that don't have an installer, so this will come in handy! Thanks again!

1 Like

j_luz :laughing: eventually... Maybe... Anyway, scrcpy don't really need a GUI, but thanks to zenzen's explicit and detailed instructions, I look forward to at least get an icon setup and running. Thanks again j_luz for all of your help and patience.

Wow, I didn't expect a continuation of support, but I'm grateful none the less. Thanks again j_luz, zenzen, and Locklear93 for continuing my education and for making me laugh. This forum is really great!

1 Like