Last active
December 18, 2015 18:49
-
-
Save kimukou/5828496 to your computer and use it in GitHub Desktop.
This file contains 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
# sampling setiing | |
# https://github.com/irof/irof_history/blob/master/android/irof_history/AndroidManifest.xml | |
# | |
pkgname=com.irof.irof_history | |
start_activity=.IrofActivity | |
if [ $# -eq 0 ]; then | |
echo "=== usage: ===" | |
echo " ./apk_install.sh XXX.apk <DEVICE-ID>" | |
echo " OR " | |
echo " ./apk_install.sh XXX.apk" | |
exit 0 | |
fi | |
if [ $# -eq 2 ]; then | |
SERIAL=$2 | |
echo " === $SERIAL start ===" | |
adb -s $SERIAL shell am force-stop $pkgname | |
adb -s $SERIAL uninstall $pkgname | |
adb -s $SERIAL install $1 | |
adb -s $SERIAL shell am start -a android.intent.action.MAIN -n $pkgname/$start_activity | |
echo " === $SERIAL end ===" | |
else | |
for SERIAL in `adb devices | sed -e "s/List of devices attached//" | sed -e "s/device//"` | |
do | |
echo " === $SERIAL start ===" | |
adb -s $SERIAL shell am force-stop $pkgname | |
adb -s $SERIAL uninstall $pkgname | |
adb -s $SERIAL install $1 | |
adb -s $SERIAL shell am start -a android.intent.action.MAIN -n $pkgname/$start_activity | |
echo " === $SERIAL end ===" | |
done | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment