Created
November 23, 2015 15:41
-
-
Save dskinner/ae723c97ea8ac60ddb58 to your computer and use it in GitHub Desktop.
godroid.sh
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 | |
function usage { | |
echo "Usage: godroid [...command]" | |
echo " build build -target android ." | |
echo " install install -r *.apk" | |
echo " run run Activity" | |
echo " logcat filter by tag GoLog since now()" | |
} | |
if [ $# -eq 0 ]; then | |
usage | |
exit 1 | |
fi | |
for var in "$@"; do | |
case "$var" in | |
build) | |
gomobile build -target android . | |
;; | |
install) | |
adb install -r *.apk | |
;; | |
run) | |
adb shell am start -n `aapt d badging *.apk | awk -F \' '/package/{printf $2"/"};/launchable/{print $2}'` | |
;; | |
logcat) | |
adb logcat -T 1 GoLog:V *:S | |
;; | |
*) | |
usage | |
exit 1 | |
;; | |
esac | |
if [ $? -ne 0 ]; then | |
exit $? | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment