Last active
March 2, 2020 20:32
-
-
Save ylogx/31c127901c4b63e96e1d to your computer and use it in GitHub Desktop.
Build Script for doing Android Studio 'run' equivalent from command line
This file contains hidden or 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 | |
PACKAGE=com.example.demo | |
ACTIVITY=.MainActivity | |
APK_LOCATION=app/build/outputs/apk/app-debug.apk | |
echo "Package: $PACKAGE" | |
echo "Building the project with tasks: $TASKS" | |
./gradlew $TASKS | |
echo "Uninstalling $PACKAGE" | |
adb uninstall $PACKAGE | |
echo "Installing $APK_LOCATION" | |
adb install $APK_LOCATION | |
echo "Starting $ACTIVITY" | |
adb shell am start -n $PACKAGE/$ACTIVITY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment