Skip to content

Instantly share code, notes, and snippets.

@framinosona
Last active October 6, 2019 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save framinosona/c4cde8ca26cf22196d6beed67555498c to your computer and use it in GitHub Desktop.
Save framinosona/c4cde8ca26cf22196d6beed67555498c to your computer and use it in GitHub Desktop.
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