Skip to content

Instantly share code, notes, and snippets.

@kimukou
Last active December 18, 2015 18:49
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 kimukou/5828496 to your computer and use it in GitHub Desktop.
Save kimukou/5828496 to your computer and use it in GitHub Desktop.
# 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