Skip to content

Instantly share code, notes, and snippets.

Last active October 6, 2019 09:53
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"
# 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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment