Skip to content

Instantly share code, notes, and snippets.

@framinosona framinosona/Scrcpy.sh
Last active Oct 6, 2019

Embed
What would you like to do?
Bash script that installs scrcpy for you if needed and starts it
#!/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
You can’t perform that action at this time.