Last active
September 29, 2015 06:56
-
-
Save boyney123/ea4326510ed25ca32013 to your computer and use it in GitHub Desktop.
Simple bash script to remove, build, install and launch your ionic app on all connected android devices (android simulators or actual devices).
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
#!/bin/sh | |
#Your app id which can be found in your config.xml file (widget id) | |
app=com.ionicframework.myNewApp | |
pathToAPK=platforms/android/build/outputs/apk/android-debug.apk | |
echo "Running Ionic Build" | |
ionic build | |
echo "Started to loop over the connected android devices" | |
for SERIAL in $(adb devices | grep -v List | cut -f 1); | |
do | |
echo "**** Uninstalling the app from the phone ****" | |
adb -s $SERIAL shell pm uninstall $app | |
echo "***** Clearing any local data stored with this app on the phone *****" | |
adb -s $SERIAL shell pm clear $app | |
echo "***** Installing the app on the phone *****" | |
adb -s $SERIAL install -r platforms/android/build/outputs/apk/android-debug.apk | |
echo "***** Launching the app on the phone *****" | |
adb -s $SERIAL shell monkey -p $app -c android.intent.category.LAUNCHER 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment