Skip to content

Instantly share code, notes, and snippets.

@hoombar
Created November 25, 2016 09:32
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 hoombar/9fe67acc582d47335c156630b18f2526 to your computer and use it in GitHub Desktop.
Save hoombar/9fe67acc582d47335c156630b18f2526 to your computer and use it in GitHub Desktop.
This is just a quick script to review changes on another branch. The current project does not have any CI and many hours are spent reviewing pull requests from more junior developers and checking they build and meet the expected criteria. This just speeds up that process
#!/bin/bash
###
# Usage:
# Suggested cloning another copy of the repo to project-review folder
# ./review.sh branch_name
# Note that the branch name should not have any spaces
# This script assumes that you have only one emulator/device connected over ADB
###
echo "Grabbing repo"
git fetch
git checkout "$1"
# in case we're already on the branch, but not up to date
git pull
echo "Building"
# build all variants, just in case they have missed something in one build flavor
./gradlew assembleDebug
echo "Deploying"
adb install -r ./app/build/outputs/apk/app-dev-debug.apk
echo "Launching"
adb shell am start -a android.intent.action.MAIN -n com.mypackage.myapp/.MainActivity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment