diff options
| author | ArenaL5 <arenal5@gmx.com> | 2019-12-04 23:56:49 +0000 |
|---|---|---|
| committer | ArenaL5 <arenal5@gmx.com> | 2019-12-04 23:56:49 +0000 |
| commit | 0506851cd6a19877f3e37fa28c23e0af4aa9a68f (patch) | |
| tree | 2d4e9be5e1333ac7ca806e0ead689c6ab9062c2c /scripts/adb.sh | |
| parent | cad0bdb35fe4eeea260bdff1f4a8cb67e3a05914 (diff) | |
| download | AnySoftKeyboard-0506851cd6a19877f3e37fa28c23e0af4aa9a68f.tar.gz AnySoftKeyboard-0506851cd6a19877f3e37fa28c23e0af4aa9a68f.tar.bz2 | |
Improve adb.sh
Adding support for -c flag.
Diffstat (limited to 'scripts/adb.sh')
| -rwxr-xr-x | scripts/adb.sh | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts/adb.sh b/scripts/adb.sh index 16b10c60c..fa9e7ab30 100755 --- a/scripts/adb.sh +++ b/scripts/adb.sh @@ -1,12 +1,20 @@ #! /bin/bash -if (( $# != 1 )); then - echo "Syntax: adb.sh [E|W|I|D|V] +# Default flags +clearlogcat=0; +if [ "$1" == "-c" ]; then + clearlogcat=1 + shift +fi +if [ $# != 1 ]; then + echo "Syntax: adb.sh [-c] {E|W|I|D|V} - adb.sh outputs a logcat and filters out lines not related with this project. + adb.sh outputs the logcat to standard output and filters out lines not related with this project. \`dalvikvm\`, \`System.err\` and \`AndroidRuntime\` are included, as those are used to debug fatal crashes. - The only argument is the initial of your log priority. (Error/Warning/Info/Debug/Verbose)" + The only argument is the initial of your log priority. (Error/Warning/Info/Debug/Verbose) + + You can optionally add the \`-c\` flag to clear the logcat prior to printing new logcat lines." else # These variables are just to higlight text: color="\033[0;36m" @@ -14,6 +22,10 @@ else error="\033[0;31m" # Retrieving current working path oldpath="$(pwd)" + if [ $clearlogcat == 1 ]; then + echo -e "${color}Clearing${nocolor} last entries…" + adb logcat -c + fi echo -e "${color}Searching${nocolor} for tags in source code…" # cd project_root_folder # This will traverse from current folder to its parent folderwork until it finds a .git folder: |
