SDL: helper scripts to uninstall/reinstall .apk

This commit is contained in:
Sergii Pylypenko
2017-11-01 17:42:27 +02:00
parent 212e761d33
commit b3b9730c19
6 changed files with 28 additions and 17 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
APK="$1"
[ -z "$APK" ] && APK=project/app/build/outputs/apk/app-release.apk
LOG=/tmp/reinstall-apk-$$.log
adb install -r "$APK" | tee $LOG
grep '^Failure' $LOG && {
adb uninstall `aapt dump badging "$APK" | grep 'package:' | sed "s/.*name='\([^']*\)'.*/\1/"`
adb install -r "$APK"
}
rm -f $LOG