Forked from boyney123/run_ionic_app_on_all_connected_android_devices.sh
Last active
April 24, 2018 08:42
-
-
Save csantanapr/f2acab418bb757e5d6a2 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