Created
August 25, 2017 13:53
-
-
Save ginkgomzd/11d872bd39a20ada778c9f30b3054f28 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
# | |
# Invoke from cordova project root | |
# Locates the apk, detects the package name, uninstalls it before installing. | |
# Starts the app using `adb shell am...` | |
# | |
adbinst() { | |
apk=`find . -name android-debug.apk` | |
platforms=`find . -maxdepth 1 -type d -name platforms` | |
if [ "$platforms" != './platforms' ] ; then echo "NOT IN PROJECT DIR"; return; fi | |
package=`awk 'match($0, /package="([^"]*)/, matches) { print matches[1] }' <./platforms/android/AndroidManifest.xml`; | |
echo "uninstall " $package | |
adb $1 uninstall $package | |
echo "install apk" $apk | |
adb $1 install $apk | |
#start the app | |
adb shell am start -n $package/.MainActivity | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment