generated from exteraGramPlugins/pluginBase
Initial commit
This commit is contained in:
commit
787965ebbf
37 files changed
+2613
No files matched your search
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
||||
source scripts/lib.sh
|
||||
|
||||
need_cmd "$ADB"
|
||||
|
||||
CLEAR=0
|
||||
STDIO=0
|
||||
PATTERN=""
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-c) CLEAR=1; shift ;;
|
||||
-t) STDIO=1; shift ;;
|
||||
-g) PATTERN="${2:-}"; shift 2 ;;
|
||||
*) die "unknown argument: $1" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$CLEAR" -eq 1 ]]; then
|
||||
"$ADB" logcat -c
|
||||
fi
|
||||
|
||||
run_logcat() {
|
||||
if [[ "$STDIO" -eq 1 ]]; then
|
||||
"$ADB" logcat -s python.stdout:'*' python.stderr:'*'
|
||||
else
|
||||
local pid
|
||||
pid="$(app_pid)"
|
||||
[[ -n "$pid" ]] || die "exteraGram is not running — open the app first"
|
||||
"$ADB" logcat --pid="$pid"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -n "$PATTERN" ]]; then
|
||||
run_logcat | grep --line-buffered -E "$PATTERN"
|
||||
else
|
||||
run_logcat
|
||||
fi
|
||||
Reference in new issue
Block a user