Skip to content

Instantly share code, notes, and snippets.

@erm3nda
Last active May 19, 2018 03:48
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 erm3nda/d4c28d62f48abfe3abd2e8ff8b10b162 to your computer and use it in GitHub Desktop.
Save erm3nda/d4c28d62f48abfe3abd2e8ff8b10b162 to your computer and use it in GitHub Desktop.
Simple bash script to install and run debug android app using Kivy and ADB, includes filtered log output option
VERBOSITY = 1
# Change Package name to suit that
PACKAGE_NAME=org.kivy.launcher
echo $PACKAGE_NAME
echo "Loading the app onto to the debug mode device."
adb install -r $PACKAGE_NAME-debug.apk
echo "Automatically (re)starting the app on the device"
adb shell monkey -p $PACKAGE_NAME -c android.intent.category.LAUNCHER 1
PID=$(adb shell ps | grep $PACKAGE_NAME | cut -c10-15)
echo $PACKAGE_NAME
echo $PID
# Print android log output to command
if (( VERBOSITY == 1 )); then
# Filter the output to this program only
echo "Logging app specific filtered output"
adb -d logcat | grep $PID
elif (( VERBOSITY > 1 )); then
# Print all android system output
echo "Logging all system output"
adb -d logcat
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment