Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OK, I gave up on scrcpy. Not computer illiterate but was expected easier install on Mac. #2256

Open
itoldusoandso opened this issue Apr 15, 2021 · 93 comments

Comments

@itoldusoandso
Copy link

MacOS 10.13
Have done as instructed.. CLT, Homebrew and scrcpy. The install process was sluggish, took 16 hours and decided to post on XDA to check sanity of what I am doing.

Sorry guys, this just didn't work out for me. Total fail ;(

Now two more hours later, the install process stayed hanging and still showing "make"... So now after 18 hours I am pulling the plug want to quit. I want to delete scrcpy and put my machine back where it was before start. However, it gives me error when I type in the command:

bash-3.2$ brew uninstall scrcpy
Error: No available formula or cask with the name "scrcpy".
bash-3.2$

So what do I do now.

See link to XDA post with picture. I don't see how to attach picture here.

https://forum.xda-developers.com/t/installing-scrcpy-now-already-more-than-16-hours-comman-line-tools-homebrew-is-this-normal.4262295/

@PembaTamang
Copy link

were you able to fix it ?

@itoldusoandso
Copy link
Author

Unfortunately not and I am still waiting on instructions on how to get rid of the software. I don't know what to do at this point.

@rom1v
Copy link
Collaborator

rom1v commented Apr 20, 2021

MacOS 10.13

Probably related: #2059

In particular: #2059 (comment)

macs that can't update their OS beyond 10.13 need to be warned that homebrew doesn't know or care if they try to update scrcpy it will install incompatible ffmpeg dependencies.

@rom1v
Copy link
Collaborator

rom1v commented Apr 20, 2021

As an alternative to Homebrew, you could try MacPorts on macOS (I don't know, I have no macOS).

@itoldusoandso
Copy link
Author

Well, I looked at MacPorts but it seems to me it's the page doesn't seem to be safe for toddlers. I need the instructions to be for a 5-years old. It's Babylon language for me as far as this is concerned.

People mention the issue starting after 1.6_2? What are your thoughts if I try same steps but I try install 1.6_2 version. Can I do that somehow?

But first I guess I need to clean the mess on my machine. I have CLT, Homebrew and scrcpy installed. So I guess I need to start removing scrcpy but I don't know how, what and where. I don't want to start deleting the stuff in home directory as I said I it's not like regular apps so stuff seems to be spread around like birds feed.

@harens
Copy link
Contributor

harens commented May 6, 2021

Hi there 👋, I'm a project member over at MacPorts. We have a port for scrcpy maintained by @MarcelBochtler that sorts out the adb tools for you.

sudo port install scrcpy

Well, I looked at MacPorts but it seems to me it's the page doesn't seem to be safe for toddlers. I need the instructions to be for a 5-years old. It's Babylon language for me as far as this is concerned.

The views expressed here are solely my own. I agree that things can certainly be improved, and we've been doing a lot of work recently to do so (see. the desolate condition thread on our mailing lists). Any suggestions you might have are warmly welcomed.

Just to help you get started, you can download MacPorts from here. Restart the terminal and then run the command I mentioned above to install scrcpy.

macs that can't update their OS beyond 10.13 need to be warned that homebrew doesn't know or care if they try to update scrcpy it will install incompatible ffmpeg dependencies.

We provide ffmpeg binaries all the way from 11 arm 64 to 10.5 ppc, and we take support of older hardware very seriously. We've had some issues building scrcpy pre-10.11 which we'll need to deal with, but we currrently provide pre-built binaries that work out the box for 10.12 upwards which should be fine for you @itoldusoandso.

If you have any questions, feel free to ask. Thanks @rom1v for maintaining this amazing project.

@itoldusoandso
Copy link
Author

itoldusoandso commented May 6, 2021

If you have any questions, feel free to ask. Thanks @rom1v for maintaining this amazing project.

harens, thank you.
OK I get it so toddler needs to learn to walk by trying to walk.

So I found here is info on uninstall brew and scrcpy package.

https://github.com/homebrew/install#uninstall-homebrew

https://osxdaily.com/2018/07/29/uninstall-packages-homebrew-mac/

Just staying in the crib and crying will not get me anywhere. I decided to mess with this stuff on my machine so I got to go with it.

Once thats done I'll follow the MacPorts instructions.

@itoldusoandso
Copy link
Author

itoldusoandso commented Feb 3, 2022

Okay back here after a while. Uninstalled and cleaned Brew directories. Installed MacPorts.
Do not know why I haven't tried it first it seems to me childsplay compared to installing Brew. Instsalled MacPorts and t's a quite small package compared to Brew downloaded 2 GB of stuff. Am I missing something. Anyhow, I am installing scrcpy but it doesn't work. I am getting message: "Port scrcpy not found"

So off to their forum to find out what is the matter. Followed exactly what it says here:

https://ports.macports.org/port/scrcpy/

bash-3.2$ sudo port install scrcpy
Error: Port scrcpy not found

Should I ask there or is it question for scrcpy?
Not sure what to think of it.

@neverpanic
Copy link

@itoldusoandso Usually, right after running the MacPorts installer, it downloads a copy of the Portfiles that are required so that sudo port install scrcpy works. It seems that didn't work in your case, possibly because you're on a network where rsync does not work.

Try running sudo port -v selfupdate - if that fails, that's probably the reason why sudo port install scrcpy does not work. In that case, I'd advise you to follow https://trac.macports.org/wiki/howto/SyncingWithGit; that should work on networks where rsync does not.

After that, sudo port install scrcpy should work.

@itoldusoandso
Copy link
Author

itoldusoandso commented Feb 4, 2022

Thank you.
I've done the self update and it went on installing the ports.

I noticed following messages in the results:

Total number of ports parsed: 30067
Ports successfully parsed: 30067
Ports failed: 0
Up-to-date ports skipped: 0
---> MacPorts base is already the latest version. The ports tree has been updated. To upgrade your installed ports, you should run port upgrade outdated

When it was downloading the packages, there were a couple of lines with a message... ---> "Computing dependencies for scrcpy Warning: All compilers are either blacklisted or unavailable; defaulting to first fallback option"

Error: No Xcode installation was found.
Error: Please install Xcode and/or run xcode-select to specify its location.

Error: Port gd2 requires a full Xcode installation, which was not found on your system.
Error: You can install Xcode from the Mac App Store or https://developer.apple.com/xcode/
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_gd2/gd2/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port scrcpy failed

---> Some of the ports you installed have notes:
libomp has the following notes:
To use this OpenMP library:
* For clang-3.8+, or clang-3.7 with +openmp variant:
add "-fopenmp" during compilation / linking.
* For clang-3.7 without +openmp variant, use:
"-I/opt/local/include/libomp -L/opt/local/lib/libomp -fopenmp"
python39 has the following notes:
To make this the default Python or Python 3 (i.e., the version run by the 'python' or 'python3'
commands), run one or both of:

    sudo port select --set python python39
    sudo port select --set python3 python39

=======

When I try to run scrcpy I get following:

scrcpy: command not found

=========================

From what I see is it tells me I need to install full Xcode? Not enough to install Command Line Tools?
I never use Xcode nor command line tools. I had it once and deleted the folder Command line tools to save 1gb space.

Is Xcode still required after Scrcpy is installed?

@neverpanic
Copy link

Xcode will not be required after scrcpy is installed. I am, however, a bit confused by the message you're getting, since gd2 (the port that failed to build) definitely builds without Xcode and only needs the Command Line Tools.

Make sure xcode-select -print-path prints /Library/Developer/CommandLineTools. If it doesn't, try sudo xcode-select -s /Library/Developer/CommandLineTools.

@rom1v
Copy link
Collaborator

rom1v commented Feb 4, 2022

Isn't there a version of homebrew/macports/other package manager on MacOS which distributes binary packages, so that users don't have to build on install?

@neverpanic
Copy link

neverpanic commented Feb 4, 2022

There is, and MacPorts has precompiled binaries for scrcpy: https://packages.macports.org/scrcpy/

Those may or may not be used depending on the user's setup, e.g., installations in locations other than /opt/local will not use binaries, or systems older than macOS 10.12 (where scrcpy doesn't build according to https://ports.macports.org/port/scrcpy/details/ because it doesn't have clock_gettime).

@LeeBinder
Copy link

LeeBinder commented May 10, 2022

The MacPorts precompiled scrcpy binaries are pretty much useless for the average user because they do require all the dependencies, too!!

scrcpy simply does require tons of dependencies to run in macOS at this point. scrcpy via MacPorts via (in the Terminal app) sudo port install scrcpy installs the exact same ones as brew!

I can share a comparison tomorrow.

@LeeBinder
Copy link

LeeBinder commented May 12, 2022

I can't report anything new here, so just for the records:

macOS Catalina with Xcode Command Line Tools (2,53 GB), homebrew as non-shallow clone (1.45 GB), adb Platform Tools (33 MB) + a few dependencies scrcpy also uses already pre-installed, because for me these are standard/ default tools I use all the time, already pre-scrcpy.

Right after running brew install scrcpy, the size of the /usr/local/ folder grew by 724 MB, almost all in /usr/local/Cellar = dependencies (98):

click to expand
$ brew deps scrcpy
aom
bdw-gc
brotli
ca-certificates
cairo
cjson
cmocka
dav1d
ffmpeg
flac
fontconfig
freetype
frei0r
fribidi
gdbm
gettext
giflib
glib
gmp
gnutls
gobject-introspection
graphite2
guile
harfbuzz
icu4c
imath
jpeg
jpeg-xl
lame
leptonica
libarchive
libass
libb2
libbluray
libevent
libffi
libidn2
libnghttp2
libogg
libpng
libpthread-stubs
librist
libsamplerate
libsndfile
libsodium
libsoxr
libtasn1
libtiff
libtool
libunistring
libusb
libvidstab
libvmaf
libvorbis
libvpx
libx11
libxau
libxcb
libxdmcp
libxext
libxrender
little-cms2
lz4
lzo
m4
mbedtls
mpdecimal
nettle
opencore-amr
openexr
openjpeg
openssl@1.1
opus
p11-kit
pcre
pixman
pkg-config
python@3.9
rav1e
readline
rubberband
sdl2
snappy
speex
sqlite
srt
tesseract
theora
unbound
webp
x264
x265
xorgproto
xvid
xz
zeromq
zimg
zstd
$ brew deps scrcpy | wc -l
    98

sudo port install scrcpy: "The following dependencies will be installed (105)":

click to expand
android-platform-tools
aom
autoconf
autoconf-archive
automake
brotli
cairo
curl-ca-bundle
dav1d
db48
ffmpeg
fontconfig
freetype
fribidi
gd2
gdbm
gdk-pixbuf2
gettext
gettext-tools-libs
giflib
glib2
gmp
gnutls
gobject-introspection
graphite2
graphviz
gts
harfbuzz
icu
jbigkit
lame
lcms2
lerc
libLASi
libass
libbluray
libde265
libheif
libidn2
libjpeg-turbo
libmodplug
libnetpbm
libogg
libopus
libpixman
libpng
librsvg
libsdl2
libtasn1
libtextstyle
libtheora
libtool
libunistring
libvorbis
libvpx
libxml2
libxslt
lz4
m4
nettle
openjpeg
ossp-uuid
p11-kit
pango
pcre
perl5.28
pkgconfig
py310-mako
py310-markdown
py310-markupsafe
py310-setuptools
python310
python3_select
rav1e
readline
shared-mime-info
soxr
speex
tiff
urw-fonts
vala
webp
x264
x265
xorg-libX11
xorg-libXau
xorg-libXaw
xorg-libXdmcp
xorg-libXext
xorg-libXmu
xorg-libXt
xorg-libice
xorg-libpthread-stubs
xorg-libsm
xorg-libxcb
xorg-xcb-proto
xorg-xcb-util
xorg-xorgproto
xpm
xrender
zimg
zstd
zvbi
Xft2
XviD

so I didn't even bother (MacPorts also lists the modules which I have already installed in brew which it doesn't see, therefore the diff in # of dependencies).

Sizes and numbers for 11.x Big Sur and 12.x Monterey will differ somewhat.

Again, this is not Romain's @rom1v fault because he currently doesn't have macOS at his fingertips, like he stated before. Therefore any package manager will simply follow its guidelines for installing.

No matter what, it's only a question of time that a nicely small stand-alone package for macOS can be created, one way or the other 👍 💯 Because looking at the Windows version, it's only a tiny number of required runtime libraries:

Bildschirmfoto 2022-05-12 um 22 26 08

@neverpanic
Copy link

port rdeps --index scrcpy will give you an idea where all those dependencies are coming from.

You'll see that a lot of them are required by librsvg, which is a dependency of ffmpeg. Assuming scrcpy does not need SVG support in ffmpeg, one could build a copy of ffmpeg that does not use librsvg using the --disable-librsvg configure flag.

However, it isn't MacPorts (or Homebrew's) goal to provide a specific version of ffmpeg that works for scrcpy – both are general purpose package managers that will provide a reasonable configuration of ffmpeg when its installation is requested, and that includes librsvg and its dependencies.

The MacPorts precompiled scrcpy binaries are pretty much useless for the average user because they do require all the dependencies, too!!

Yes. These precompiled binaries are not meant to be used outside of MacPorts, which will ensure that the required dependencies are also available. They simply save compilation time. I'm not intimately familiar with Homebrew's "bottles" concept, but I think they have the same approach.

What those binaries give you is avoiding local compilation, though. For example, there's no need to install & compile rust, because MacPorts has a precompiled copy of librsvg available: https://ports.macports.org/port/librsvg/details/.

No matter what, it's only a question of time that a nicely small stand-alone package for macOS can be created, one way or the other

You can do this using dylibbundler from the MacPorts scrcpy package:

$> mkdir /tmp/scrcpy
$> cp /opt/local/bin/scrcpy /tmp/scrcpy
$> cd /tmp/scrcpy
$> dylibbundler -b --create-dir --dest-dir libs --install-path '@executable_path/libs' -x scrcpy
$> cp /opt/local/bin/adb .
$> cp /opt/local/share/scrcpy/scrcpy-server .
$> ADB=/tmp/scrcpy/adb SCRCPY_SERVER_PATH=/tmp/scrcpy/scrcpy-server ./scrcpy

You'd probably also have to ship a copy of adb, processed using the same method (although it seems that adb does not actually link against any external libraries that aren't usually present on macOS).

Such a package will also be quite large, though:

$> du -sh /tmp/scrcpy
103M	/tmp/scrcpy/

Additionally, you'd have to comply with the licenses of all bundled binaries when re-distributing, which is also why I will not provide the one I just built anywhere.

@LeeBinder
Copy link

very nice, great info - thanks for sharing it all.

So your self-compiled 103 MB package of scrcpy contains all required dependencies and is working fine for you even after removing scrcpy with all its dependencies via both, MacPorts and homebrew = is true stand-alone?

@neverpanic
Copy link

So your self-compiled 103 MB package of scrcpy contains all required dependencies and is working fine for you even after removing scrcpy with all its dependencies via both, MacPorts and homebrew = is true stand-alone?

I don't have a phone available at the machine I'm currently at, so I didn't actually test the functionality. It does start successfully (and then fails to find a phone), though. I had the MacPorts scrcpy port deactivated when I tested this, but all other dependencies still installed. I did check the scrcpy binary with otool -L and it used the copy of the dependencies from the libs/ directory, not the MacPorts-installed ones. That should make it stand-alone.

@LeeBinder
Copy link

great, thank you, neverpanic! Installing scrcpy via MacPorts right now, then will execute your script. Will leave the house now so it'll be a while before I report back if all went well.

@LeeBinder
Copy link

one more install command was necessary here for me so dylibbundler -b ... would run:

sudo port install libusb

full report follows later

@LeeBinder
Copy link

It's running 100% fine form what I can tell so far 👍 🥇

Now we can clean-up:

sudo port uninstall --follow-dependencies scrcpy
sudo port uninstall inactive

.. and here's the icon for the app (3kb 8-bit PNG 256x256) :):
Icon

neverpanic added a commit to neverpanic/macports-ports that referenced this issue May 13, 2022
The scrcpy binary links against libusb, so it should be available at
runtime:

| $> otool -L /opt/local/bin/scrcpy | grep libusb
|   /opt/local/lib/libusb-1.0.0.dylib (compatibility version 4.0.0, current version 4.0.0)
| $> port provides /opt/local/lib/libusb-1.0.0.dylib
| /opt/local/lib/libusb-1.0.0.dylib is provided by: libusb

See Genymobile/scrcpy#2256 (comment).
neverpanic added a commit to macports/macports-ports that referenced this issue May 13, 2022
The scrcpy binary links against libusb, so it should be available at
runtime:

| $> otool -L /opt/local/bin/scrcpy | grep libusb
|   /opt/local/lib/libusb-1.0.0.dylib (compatibility version 4.0.0, current version 4.0.0)
| $> port provides /opt/local/lib/libusb-1.0.0.dylib
| /opt/local/lib/libusb-1.0.0.dylib is provided by: libusb

See Genymobile/scrcpy#2256 (comment).
@LeeBinder
Copy link

LeeBinder commented Nov 25, 2023

Trying to compile v.2.3 via the script above, adapted to use scrcpy-server-v2.3.

@dur-randir @Coool Do you have any idea how to get beyond these errors during compilation? Maybe something from system-specific steps that needs to be incorporated?

Checking for function "reallocarray" : NO 
Header "sys/socket.h" has symbol "SOCK_CLOEXEC" : NO

[1/63] Compiling C object app/scrcpy.p/src_cli.c.o
FAILED: app/scrcpy.p/src_cli.c.o 
cc -Iapp/scrcpy.p -Iapp -I../app -I../app/src -I/tmp/ffmpeg/include -I/opt/local/include -I/opt/local/include/SDL2 -I/opt/local/include/libusb-1.0 -flto -fcolor-diagnostics -DNDEBUG -Wall -Winvalid-pch -Wextra -std=c11 -O3 -Wmissing-prototypes -D_THREAD_SAFE -MD -MQ app/scrcpy.p/src_cli.c.o -MF app/scrcpy.p/src_cli.c.o.d -o app/scrcpy.p/src_cli.c.o -c ../app/src/cli.c
../app/src/cli.c:2158:17: error: expected expression
                enum sc_orientation orientation;
                ^
../app/src/cli.c:2159:49: error: use of undeclared identifier 'orientation'; did you mean 'rotation'?
                if (!parse_orientation(optarg, &orientation)) {
                                                ^~~~~~~~~~~
                                                rotation
../app/src/cli.c:2123:25: note: 'rotation' declared here
                uint8_t rotation;
                        ^
../app/src/cli.c:2162:45: error: use of undeclared identifier 'orientation'; did you mean 'rotation'?
                opts->display_orientation = orientation;
                                            ^~~~~~~~~~~
                                            rotation
../app/src/cli.c:2123:25: note: 'rotation' declared here
                uint8_t rotation;
                        ^
../app/src/cli.c:2163:44: error: use of undeclared identifier 'orientation'; did you mean 'rotation'?
                opts->record_orientation = orientation;
                                           ^~~~~~~~~~~
                                           rotation
../app/src/cli.c:2123:25: note: 'rotation' declared here
                uint8_t rotation;
                        ^
4 errors generated.
[10/63] Compiling C object app/scrcpy.p/src_audio_player.c.o
ninja: build stopped: subcommand failed.

@rom1v
Copy link
Collaborator

rom1v commented Nov 25, 2023

@LeeBinder

diff --git a/app/src/cli.c b/app/src/cli.c
index f57b75efc..fd4525f55 100644
--- a/app/src/cli.c
+++ b/app/src/cli.c
@@ -2154,7 +2154,7 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
                     return false;
                 }
                 break;
-            case OPT_ORIENTATION:
+            case OPT_ORIENTATION: {
                 enum sc_orientation orientation;
                 if (!parse_orientation(optarg, &orientation)) {
                     return false;
@@ -2162,6 +2162,7 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
                 opts->display_orientation = orientation;
                 opts->record_orientation = orientation;
                 break;
+            }
             case OPT_RENDER_DRIVER:
                 opts->render_driver = optarg;
                 break;

Does it fix the problem?

If yes, I will push it to master.

(On Linux, both with gcc and clang, this is just a warning with -Wpedantic enabled.)

rom1v added a commit that referenced this issue Nov 25, 2023
Fix the following warning/error:

    ../app/src/cli.c:2158:17: warning: a label can only be part of a
    statement and a declaration is not a statement [-Wpedantic]

With some compilers, this is an error rather than a pedantic warning.

Refs <#2256 (comment)>
@LeeBinder
Copy link

@rom1v Adapted app/src/cli.c to look as follows (omitted @@ -2162,6 +2162,7 @@):

            case OPT_ORIENTATION: {
                 enum sc_orientation orientation;
                 if (!parse_orientation(optarg, &orientation)) {
                     return false;
                      parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
                 opts->display_orientation = orientation;
                 opts->record_orientation = orientation;
                 break;
           }
            case OPT_RENDER_DRIVER:
......

Result:

[4/63] Compiling C object app/scrcpy.p/src_cli.c.o
FAILED: app/scrcpy.p/src_cli.c.o 
cc -Iapp/scrcpy.p -Iapp -I../app -I../app/src -I/tmp/ffmpeg/include -I/opt/local/include -I/opt/local/include/SDL2 -I/opt/local/include/libusb-1.0 -flto -fcolor-diagnostics -DNDEBUG -Wall -Winvalid-pch -Wextra -std=c11 -O3 -Wmissing-prototypes -D_THREAD_SAFE -MD -MQ app/scrcpy.p/src_cli.c.o -MF app/scrcpy.p/src_cli.c.o.d -o app/scrcpy.p/src_cli.c.o -c ../app/src/cli.c
../app/src/cli.c:2161:46: error: expected expression
                      parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
                                             ^
../app/src/cli.c:2161:76: error: expected expression
                      parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
                                                                           ^
../app/src/cli.c:2161:86: error: expected expression
                      parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
                                                                                     ^
../app/src/cli.c:2665:46: error: function definition is not allowed here
sc_get_pause_on_exit(int argc, char *argv[]) {
                                             ^
../app/src/cli.c:2696:73: error: function definition is not allowed here
scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
                                                                        ^
../app/src/cli.c:2715:2: error: expected '}'
}
 ^
../app/src/cli.c:1938:78: note: to match this '{'
                       const char *optstring, const struct option *longopts) {
                                                                             ^
6 errors generated.
[13/63] Compiling C object app/scrcpy.p/src_audio_player.c.o
ninja: build stopped: subcommand failed.

Would maybe fixing

Checking for function "reallocarray" : NO 
Header "sys/socket.h" has symbol "SOCK_CLOEXEC" : NO

need to be tackled first?

@rom1v
Copy link
Collaborator

rom1v commented Nov 25, 2023

Please test the current dev branch.

@LeeBinder
Copy link

LeeBinder commented Nov 25, 2023

git clone https://github.com/Genymobile/scrcpy/tree/dev?

@rom1v
Copy link
Collaborator

rom1v commented Nov 25, 2023

git checkout dev or git switch dev.

@LeeBinder
Copy link

neither

git clone https://github.com/Genymobile/scrcpy && git checkout dev

nor

git clone https://github.com/Genymobile/scrcpy && git switch dev

work.

Can you please share the complete command which command works for you?

@rom1v
Copy link
Collaborator

rom1v commented Nov 25, 2023

git clone https://github.com/Genymobile/scrcpy
cd scrcpy
git checkout dev

Or since you re-clone the repo, directly specify the branch:

git clone https://github.com/Genymobile/scrcpy -b dev

@LeeBinder
Copy link

LeeBinder commented Nov 26, 2023

Fabulous: scrcpy 2.3 RUNNING in macOS - thank you Romain🥇 So you can push that commit to master 👍

What am I missing w/o:

function "reallocarray" : NO 
Header "sys/socket.h" has symbol "SOCK_CLOEXEC" : NO

Should these be included, and if yes, how would the macOS (Intel) compilation script need to be updated?

@rom1v
Copy link
Collaborator

rom1v commented Nov 26, 2023

That's expected, this is not an error. On platforms where the symbol is not available, scrcpy automatically does differently.

@rom1v
Copy link
Collaborator

rom1v commented Nov 26, 2023

Oops, I put the wrong comment link in the fix: 4135c41.

It should have been: #2256 (comment) rather than #2256 (comment). Too late, it's on master for too long.

theofficialgman added a commit to Botspot/pi-apps that referenced this issue Nov 26, 2023
apply patch from master branch referenced in Genymobile/scrcpy#2256 (comment)
theofficialgman added a commit to Botspot/pi-apps that referenced this issue Nov 26, 2023
apply patch from master branch referenced in Genymobile/scrcpy#2256 (comment)
@rom1v
Copy link
Collaborator

rom1v commented Mar 2, 2024

You might be interested in #4713, which builds all the dependencies for Windows (32 and 64 bit).

It probably does not require a lot of changes to make it work for macOS.

@LeeBinder
Copy link

@rom1v thank you for the new 2.4 with so many new awesome features 👍

In macOS, should I also compile with:

  • FFmpeg 6.1.1
  • libusb 1.0.27

and Python: change from 3.11 to 3.12, or that doesn't matter?

@rom1v
Copy link
Collaborator

rom1v commented Mar 4, 2024

Why do you need python?

@LeeBinder
Copy link

Python: as per dur-randir original compile script for macOS.

So what about the other two dependencies. v.2.4 compiled fine in macOS Monterey with FFmpeg 6.0 and libusb 1.0, and runs. Haven't had any time yet though to test functions.

I'll run the build script again w/o Python and with FFmpeg 6.1.1 + libusb 1.0.27 in macOS Sonoma when I'm back and have time again (unless you advise to stick to the older v.1.0 binaries for macOS).

@LeeBinder
Copy link

LeeBinder commented Mar 6, 2024

Why do you need python?

"I" don't, but meson (which this MacPorts-based install script uses) does :):

$ 1. Install build deps + their sub-deps (all can be safely removed afterwards)
$ sudo port -N install meson cmake pkgconfig nasm
--->  Computing dependencies for meson
--->  Dependencies to be installed: py312-meson python312 py312-setuptools ninja bzip2 expat gettext-runtime libedit libffi ncurses openssl sqlite3 xz zlib python_select-312 python3_select-312 libiconv openssl3 python_select python3_select

-> stand-alone native Mac (Intel) APP at the bottom of this comment of mine 😉

@mailinglists35
Copy link

so is there any mac arm binary available for downloading from somwehere?

@mailinglists35
Copy link

build scrcpy (Intel) v2.4.command (v.2024-03-06) [ !! WORKING thanks to @rom1v !! ] - click to expand
Credits go to dur-randir w/o who's instructions this would never have been possible!

[...]

scrcpy 2.4 (Intel) App (2024-03-07_10.45).txz.zip - stand-alone as a native Mac (Intel) APP 😉

thank you! seems to work using rosetta

@TB-SUMIT
Copy link

If you install scrcpy by brew then you can uninstall it by using command "brew uninstall scrcpy"
brew uninstall scrcpy
image

@rom1v
Copy link
Collaborator

rom1v commented Sep 19, 2024

Please check #5306, and maybe try to add a job for macOS (I think only few changes are to be made to app/deps/ scripts to build dependencies for macOS, and a macOS-specific job in the GitHub Actions workflow).

@fungalistmassive
Copy link

ok i dont understand whats happening here....
i have an imac with big sur os.... trying to install this in terminal, but it got stuck or something cause has been 4 hours and no changes in terminal
can someone help?

🍺 /usr/local/Cellar/libgit2/1.8.1: 106 files, 4.6MB, built in 54 seconds
==> Installing scrcpy dependency: llvm@18
==> cmake -G Ninja .. -DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld;mlir;polly -DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libcxxabi;libunwind -DLLVM_POLLY_LINK_INTO_TOOLS=ON -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON -DLLVM_LINK_LLV
==> cmake --build .
stuck here

@LgnGithub
Copy link

Followed MacOS guide, doesn't work.

  1. brew install scrcpy OK

  2. brew install scrcpy OK

  3. sudo port install scrcpy
    sudo: port: command not found

@neverpanic
Copy link

Followed MacOS guide, doesn't work.

1. brew install scrcpy OK

2. brew install scrcpy OK

3. sudo port install scrcpy
   sudo: port: command not found

You're supposed to read the text in between the commands, too. There it says:

Alternatively, Scrcpy is also available in MacPorts, which sets up adb for you:

I.e., you use either brew or MacPorts, not both.

@LeeBinder
Copy link

scrcpy 2.7 (Intel) app.zip

based on Genxster1998's build, see here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests