Last active
May 31, 2024 17:20
-
-
Save framinosona/c4cde8ca26cf22196d6beed67555498c to your computer and use it in GitHub Desktop.
Bash script that installs scrcpy for you if needed and starts it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Script to start Scrcpy | |
if test ! $(which scrcpy); then | |
echo "Starting installation" | |
# Check for Homebrew, install if we don't have it | |
if test ! $(which brew); then | |
echo "Installing homebrew..." | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
# Update homebrew recipes | |
brew update | |
echo "Installing scrcpy..." | |
brew install scrcpy | |
if test ! $(which adb); then | |
echo "Installing android-platform-tools..." | |
brew cask install android-platform-tools | |
fi | |
echo "Scrcpy is installed, you may need to restart your terminal" | |
echo "Your Homebrew might be messy now, to cleanup run :" | |
echo " brew cleanup" | |
echo "" | |
#reloading terminal | |
source ~/.bash_profile | |
fi | |
scrcpy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment