As a user, I'd like to be able to install scrcpy with a single brew install scrcpy command so that I can quickly start using the program without needing to install meson or gcc.
It's worth noting that pre-built binaries are optional, as Homebrew supports Formulas that build during installation.
It's worth noting that pre-built binaries are optional, as Homebrew supports Formulas that build during installation.
Cool :+1: If someone is interested in writing it, it would help a lot! (like @nvllsvm did for the Arch Linux package).
I'm working on a Homebrew formula. Soon...
See homebrew/homebrew-core#25173.
@nvllsvm Sorry, I haven't seen this issue and your comment :
@jonasfa
It's worth noting that pre-built binaries are optional, as Homebrew supports Formulas that build during installation.
Not for the server part since it depends on android-sdk.
However, here's kinda shell script to build it, tested on fresh vm with only homebrew installed:
# Install runtime dependencies
brew install sdl2 ffmpeg
# Install runtime dependencies
brew install pkg-config meson
# Install java8
brew tap caskroom/versions
brew cask install java8
# "Select" java version
export JAVA_HOME="$(/usr/libexec/java_home --version 1.8)"
export PATH="$JAVA_HOME/bin:$PATH"
# Install Android SDK
brew cask install android-sdk
export ANDROID_HOME="/usr/local/share/android-sdk"
# Install platform-tools
sdkmanager platform-tools
# Accept all licenses
sdkmanager --licenses
# Clone repo if you haven't done it already
git clone https://github.com/Genymobile/scrcpy.git
cd scrcpy
# Build
meson x --buildtype release --strip -Db_lto=true
cd x
ninja
# Run
export ADB="$ANDROID_HOME/platform-tools/adb"
ninja run
# You may want to add $ADB to your rc file, or
# add $ANDROID_HOME/platform-tools to your PATH
However, sdkmanager --licenses is interactive and blocking, and I'm not really sure on how to "automate" it.
@Kyle-Falconer As a user, you'd still need adb :)
Also, gcc is not needed. Whoever put it there most likely is new in macOS world :P
gcc is usually needed only for (what I consider) poor software using GCC specific stuff. That doesn't happen often.
Whoever put it there most likely is new in macOS world
I confirm, I'm more than a newbie on MacOS. I had to use a Mac to test _scrcpy_, it was difficult for me even to use the keyboard and find how to open a terminal :laughing: (and using Windows is even worse :trollface:)
But a C compiler is already installed on all MacOS by default?
gccis usually needed only for (what I consider) poor software
The Linux kernel? :grin:
However, sdkmanager --licenses is interactive and blocking, and I'm not really sure on how to "automate" it.
yes | sdkmanager --licenses should do the trick!
Surely there are some negative legal repercussions here for accepting a user agreement on someone else's behalf.
My preference for this is to require the user to set up the Android SDK, JDK, and environment variables by themselves, and if the scrcpy installer detects that the environment is not set up correctly, give a meaningful error message and instruct the user how to resolve the issue.
As an Android dev, I never rely upon system package managers to install the SDK. Instead, Android Studio and included tools like sdkmanager are used.
The Arch package mirrors this philosophy and has no hard dependency on anything Android-specific:
android-sdk-platform-tools as an optional package to install adbAny hard requirement on the SDK would be bloat in my eyes.
I love how people commenting here haven't even read proposed brew formula sources.
Dear @nvllsvm @Kyle-Falconer,
See https://github.com/Homebrew/homebrew-core/pull/25173#issuecomment-372528981.
scrcpy has a "server" which is pushed to device and ran on it.
However, building it requires android sdk, which is only available as cask, is heavy and requires additional configuration and user interaction before usage.So instead I opted out for just using prebuilt server provided by maintainer.
Also, in the commit with "kinda shell script" using android sdk:
https://github.com/Genymobile/scrcpy/issues/19#issuecomment-372529394
It's worth noting that pre-built binaries are optional, as Homebrew supports Formulas that build during installation.
Not for the server part since it depends on android-sdk.
So, instructions/"kinda shell script" provided are more about CI/test builds of server and not about building it for people who are already android developers, and definitely have nothing to do with homebrew.
If you're android developer, I don't think you'd even need to read that "kinda shell script"
Now the PR from @stek29 is merged, I can close this issue :tada:
brew install scrcpy
Thank you :)
Most helpful comment
I'm working on a Homebrew formula. Soon...